typescript 5.0.0-dev.20221212 → 5.0.0-dev.20221214

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,7 +50,7 @@ var path = __toESM(require("path"));
50
50
 
51
51
  // src/compiler/corePublic.ts
52
52
  var versionMajorMinor = "5.0";
53
- var version = `${versionMajorMinor}.0-dev.20221212`;
53
+ var version = `${versionMajorMinor}.0-dev.20221214`;
54
54
 
55
55
  // src/compiler/core.ts
56
56
  var emptyArray = [];
@@ -2844,23 +2844,25 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
2844
2844
  SyntaxKind4[SyntaxKind4["JSDocReadonlyTag"] = 339] = "JSDocReadonlyTag";
2845
2845
  SyntaxKind4[SyntaxKind4["JSDocOverrideTag"] = 340] = "JSDocOverrideTag";
2846
2846
  SyntaxKind4[SyntaxKind4["JSDocCallbackTag"] = 341] = "JSDocCallbackTag";
2847
- SyntaxKind4[SyntaxKind4["JSDocEnumTag"] = 342] = "JSDocEnumTag";
2848
- SyntaxKind4[SyntaxKind4["JSDocParameterTag"] = 343] = "JSDocParameterTag";
2849
- SyntaxKind4[SyntaxKind4["JSDocReturnTag"] = 344] = "JSDocReturnTag";
2850
- SyntaxKind4[SyntaxKind4["JSDocThisTag"] = 345] = "JSDocThisTag";
2851
- SyntaxKind4[SyntaxKind4["JSDocTypeTag"] = 346] = "JSDocTypeTag";
2852
- SyntaxKind4[SyntaxKind4["JSDocTemplateTag"] = 347] = "JSDocTemplateTag";
2853
- SyntaxKind4[SyntaxKind4["JSDocTypedefTag"] = 348] = "JSDocTypedefTag";
2854
- SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 349] = "JSDocSeeTag";
2855
- SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 350] = "JSDocPropertyTag";
2856
- SyntaxKind4[SyntaxKind4["SyntaxList"] = 351] = "SyntaxList";
2857
- SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 352] = "NotEmittedStatement";
2858
- SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 353] = "PartiallyEmittedExpression";
2859
- SyntaxKind4[SyntaxKind4["CommaListExpression"] = 354] = "CommaListExpression";
2860
- SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 355] = "MergeDeclarationMarker";
2861
- SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 356] = "EndOfDeclarationMarker";
2862
- SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 357] = "SyntheticReferenceExpression";
2863
- SyntaxKind4[SyntaxKind4["Count"] = 358] = "Count";
2847
+ SyntaxKind4[SyntaxKind4["JSDocOverloadTag"] = 342] = "JSDocOverloadTag";
2848
+ SyntaxKind4[SyntaxKind4["JSDocEnumTag"] = 343] = "JSDocEnumTag";
2849
+ SyntaxKind4[SyntaxKind4["JSDocParameterTag"] = 344] = "JSDocParameterTag";
2850
+ SyntaxKind4[SyntaxKind4["JSDocReturnTag"] = 345] = "JSDocReturnTag";
2851
+ SyntaxKind4[SyntaxKind4["JSDocThisTag"] = 346] = "JSDocThisTag";
2852
+ SyntaxKind4[SyntaxKind4["JSDocTypeTag"] = 347] = "JSDocTypeTag";
2853
+ SyntaxKind4[SyntaxKind4["JSDocTemplateTag"] = 348] = "JSDocTemplateTag";
2854
+ SyntaxKind4[SyntaxKind4["JSDocTypedefTag"] = 349] = "JSDocTypedefTag";
2855
+ SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 350] = "JSDocSeeTag";
2856
+ SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 351] = "JSDocPropertyTag";
2857
+ SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 352] = "JSDocThrowsTag";
2858
+ SyntaxKind4[SyntaxKind4["SyntaxList"] = 353] = "SyntaxList";
2859
+ SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 354] = "NotEmittedStatement";
2860
+ SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression";
2861
+ SyntaxKind4[SyntaxKind4["CommaListExpression"] = 356] = "CommaListExpression";
2862
+ SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 357] = "MergeDeclarationMarker";
2863
+ SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 358] = "EndOfDeclarationMarker";
2864
+ SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 359] = "SyntheticReferenceExpression";
2865
+ SyntaxKind4[SyntaxKind4["Count"] = 360] = "Count";
2864
2866
  SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
2865
2867
  SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
2866
2868
  SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -2889,9 +2891,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
2889
2891
  SyntaxKind4[SyntaxKind4["LastStatement"] = 256 /* DebuggerStatement */] = "LastStatement";
2890
2892
  SyntaxKind4[SyntaxKind4["FirstNode"] = 163 /* QualifiedName */] = "FirstNode";
2891
2893
  SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 312 /* JSDocTypeExpression */] = "FirstJSDocNode";
2892
- SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 350 /* JSDocPropertyTag */] = "LastJSDocNode";
2894
+ SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocNode";
2893
2895
  SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 330 /* JSDocTag */] = "FirstJSDocTagNode";
2894
- SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 350 /* JSDocPropertyTag */] = "LastJSDocTagNode";
2896
+ SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocTagNode";
2895
2897
  SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 126 /* AbstractKeyword */] = "FirstContextualKeyword";
2896
2898
  SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 162 /* OfKeyword */] = "LastContextualKeyword";
2897
2899
  return SyntaxKind4;
@@ -3197,6 +3199,7 @@ var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => {
3197
3199
  ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs";
3198
3200
  ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16";
3199
3201
  ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext";
3202
+ ModuleResolutionKind2[ModuleResolutionKind2["Bundler"] = 100] = "Bundler";
3200
3203
  return ModuleResolutionKind2;
3201
3204
  })(ModuleResolutionKind || {});
3202
3205
  var TransformFlags = /* @__PURE__ */ ((TransformFlags3) => {
@@ -5908,6 +5911,7 @@ var Diagnostics = {
5908
5911
  We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1 /* Error */, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
5909
5912
  Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1 /* Error */, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
5910
5913
  This_condition_will_always_return_0: diag(2845, 1 /* Error */, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."),
5914
+ A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead: diag(2846, 1 /* Error */, "A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_f_2846", "A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '{0}' instead?"),
5911
5915
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
5912
5916
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
5913
5917
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -6072,6 +6076,11 @@ var Diagnostics = {
6072
6076
  Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."),
6073
6077
  Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
6074
6078
  Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."),
6079
+ Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_moduleResolution_is_set_to_bundler_and_eithe_5096", "Option 'allowImportingTsExtensions' can only be used when 'moduleResolution' is set to 'bundler' and either 'noEmit' or 'emitDeclarationOnly' is set."),
6080
+ An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
6081
+ Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
6082
+ Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(5099, 1 /* Error */, "Import_assignment_is_not_allowed_when_moduleResolution_is_set_to_bundler_Consider_using_import_Aster_5099", `Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`),
6083
+ Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_default_or_another_module_format_instead: diag(5100, 1 /* Error */, "Export_assignment_cannot_be_used_when_moduleResolution_is_set_to_bundler_Consider_using_export_defau_5100", "Export assignment cannot be used when 'moduleResolution' is set to 'bundler'. Consider using 'export default' or another module format instead."),
6075
6084
  Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."),
6076
6085
  Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
6077
6086
  Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
@@ -6127,7 +6136,6 @@ var Diagnostics = {
6127
6136
  Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line: diag(6064, 1 /* Error */, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),
6128
6137
  Enables_experimental_support_for_ES7_decorators: diag(6065, 3 /* Message */, "Enables_experimental_support_for_ES7_decorators_6065", "Enables experimental support for ES7 decorators."),
6129
6138
  Enables_experimental_support_for_emitting_type_metadata_for_decorators: diag(6066, 3 /* Message */, "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066", "Enables experimental support for emitting type metadata for decorators."),
6130
- Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: diag(6069, 3 /* Message */, "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069", "Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)."),
6131
6139
  Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: diag(6070, 3 /* Message */, "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", "Initializes a TypeScript project and creates a tsconfig.json file."),
6132
6140
  Successfully_created_a_tsconfig_json_file: diag(6071, 3 /* Message */, "Successfully_created_a_tsconfig_json_file_6071", "Successfully created a tsconfig.json file."),
6133
6141
  Suppress_excess_property_checks_for_object_literals: diag(6072, 3 /* Message */, "Suppress_excess_property_checks_for_object_literals_6072", "Suppress excess property checks for object literals."),
@@ -6371,6 +6379,11 @@ var Diagnostics = {
6371
6379
  Using_0_subpath_1_with_target_2: diag(6404, 3 /* Message */, "Using_0_subpath_1_with_target_2_6404", "Using '{0}' subpath '{1}' with target '{2}'."),
6372
6380
  Saw_non_matching_condition_0: diag(6405, 3 /* Message */, "Saw_non_matching_condition_0_6405", "Saw non-matching condition '{0}'."),
6373
6381
  Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions: diag(6406, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions_6406", "Project '{0}' is out of date because buildinfo file '{1}' indicates there is change in compilerOptions"),
6382
+ Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set: diag(6407, 3 /* Message */, "Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noE_6407", "Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set."),
6383
+ Use_the_package_json_exports_field_when_resolving_package_imports: diag(6408, 3 /* Message */, "Use_the_package_json_exports_field_when_resolving_package_imports_6408", "Use the package.json 'exports' field when resolving package imports."),
6384
+ Use_the_package_json_imports_field_when_resolving_imports: diag(6409, 3 /* Message */, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."),
6385
+ Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: diag(6410, 3 /* Message */, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."),
6386
+ true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: diag(6411, 3 /* Message */, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),
6374
6387
  The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
6375
6388
  The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
6376
6389
  The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
@@ -9046,8 +9059,8 @@ function getNonAssignedNameOfDeclaration(declaration) {
9046
9059
  switch (declaration.kind) {
9047
9060
  case 79 /* Identifier */:
9048
9061
  return declaration;
9049
- case 350 /* JSDocPropertyTag */:
9050
- case 343 /* JSDocParameterTag */: {
9062
+ case 351 /* JSDocPropertyTag */:
9063
+ case 344 /* JSDocParameterTag */: {
9051
9064
  const { name } = declaration;
9052
9065
  if (name.kind === 163 /* QualifiedName */) {
9053
9066
  return name.right;
@@ -9071,9 +9084,9 @@ function getNonAssignedNameOfDeclaration(declaration) {
9071
9084
  return void 0;
9072
9085
  }
9073
9086
  }
9074
- case 348 /* JSDocTypedefTag */:
9087
+ case 349 /* JSDocTypedefTag */:
9075
9088
  return getNameOfJSDocTypedef(declaration);
9076
- case 342 /* JSDocEnumTag */:
9089
+ case 343 /* JSDocEnumTag */:
9077
9090
  return nameForNamelessJSDocTypedef(declaration);
9078
9091
  case 274 /* ExportAssignment */: {
9079
9092
  const { expression } = declaration;
@@ -9165,6 +9178,8 @@ function getJSDocTypeTag(node) {
9165
9178
  return void 0;
9166
9179
  }
9167
9180
  function getJSDocTagsWorker(node, noCache) {
9181
+ if (!canHaveJSDoc(node))
9182
+ return emptyArray;
9168
9183
  let tags = node.jsDocCache;
9169
9184
  if (tags === void 0 || noCache) {
9170
9185
  const comments = getJSDocCommentsAndTags(node, noCache);
@@ -9472,8 +9487,8 @@ function isExpressionKind(kind) {
9472
9487
  case 227 /* SpreadElement */:
9473
9488
  case 231 /* AsExpression */:
9474
9489
  case 229 /* OmittedExpression */:
9475
- case 354 /* CommaListExpression */:
9476
- case 353 /* PartiallyEmittedExpression */:
9490
+ case 356 /* CommaListExpression */:
9491
+ case 355 /* PartiallyEmittedExpression */:
9477
9492
  case 235 /* SatisfiesExpression */:
9478
9493
  return true;
9479
9494
  default:
@@ -9497,18 +9512,126 @@ function isNamedImportBindings(node) {
9497
9512
  const kind = node.kind;
9498
9513
  return kind === 272 /* NamedImports */ || kind === 271 /* NamespaceImport */;
9499
9514
  }
9515
+ function canHaveSymbol(node) {
9516
+ switch (node.kind) {
9517
+ case 216 /* ArrowFunction */:
9518
+ case 223 /* BinaryExpression */:
9519
+ case 205 /* BindingElement */:
9520
+ case 210 /* CallExpression */:
9521
+ case 176 /* CallSignature */:
9522
+ case 260 /* ClassDeclaration */:
9523
+ case 228 /* ClassExpression */:
9524
+ case 172 /* ClassStaticBlockDeclaration */:
9525
+ case 173 /* Constructor */:
9526
+ case 182 /* ConstructorType */:
9527
+ case 177 /* ConstructSignature */:
9528
+ case 209 /* ElementAccessExpression */:
9529
+ case 263 /* EnumDeclaration */:
9530
+ case 302 /* EnumMember */:
9531
+ case 274 /* ExportAssignment */:
9532
+ case 275 /* ExportDeclaration */:
9533
+ case 278 /* ExportSpecifier */:
9534
+ case 259 /* FunctionDeclaration */:
9535
+ case 215 /* FunctionExpression */:
9536
+ case 181 /* FunctionType */:
9537
+ case 174 /* GetAccessor */:
9538
+ case 79 /* Identifier */:
9539
+ case 270 /* ImportClause */:
9540
+ case 268 /* ImportEqualsDeclaration */:
9541
+ case 273 /* ImportSpecifier */:
9542
+ case 178 /* IndexSignature */:
9543
+ case 261 /* InterfaceDeclaration */:
9544
+ case 341 /* JSDocCallbackTag */:
9545
+ case 343 /* JSDocEnumTag */:
9546
+ case 320 /* JSDocFunctionType */:
9547
+ case 344 /* JSDocParameterTag */:
9548
+ case 351 /* JSDocPropertyTag */:
9549
+ case 326 /* JSDocSignature */:
9550
+ case 349 /* JSDocTypedefTag */:
9551
+ case 325 /* JSDocTypeLiteral */:
9552
+ case 288 /* JsxAttribute */:
9553
+ case 289 /* JsxAttributes */:
9554
+ case 290 /* JsxSpreadAttribute */:
9555
+ case 197 /* MappedType */:
9556
+ case 171 /* MethodDeclaration */:
9557
+ case 170 /* MethodSignature */:
9558
+ case 264 /* ModuleDeclaration */:
9559
+ case 199 /* NamedTupleMember */:
9560
+ case 277 /* NamespaceExport */:
9561
+ case 267 /* NamespaceExportDeclaration */:
9562
+ case 271 /* NamespaceImport */:
9563
+ case 211 /* NewExpression */:
9564
+ case 14 /* NoSubstitutionTemplateLiteral */:
9565
+ case 8 /* NumericLiteral */:
9566
+ case 207 /* ObjectLiteralExpression */:
9567
+ case 166 /* Parameter */:
9568
+ case 208 /* PropertyAccessExpression */:
9569
+ case 299 /* PropertyAssignment */:
9570
+ case 169 /* PropertyDeclaration */:
9571
+ case 168 /* PropertySignature */:
9572
+ case 175 /* SetAccessor */:
9573
+ case 300 /* ShorthandPropertyAssignment */:
9574
+ case 308 /* SourceFile */:
9575
+ case 301 /* SpreadAssignment */:
9576
+ case 10 /* StringLiteral */:
9577
+ case 262 /* TypeAliasDeclaration */:
9578
+ case 184 /* TypeLiteral */:
9579
+ case 165 /* TypeParameter */:
9580
+ case 257 /* VariableDeclaration */:
9581
+ return true;
9582
+ default:
9583
+ return false;
9584
+ }
9585
+ }
9586
+ function canHaveLocals(node) {
9587
+ switch (node.kind) {
9588
+ case 216 /* ArrowFunction */:
9589
+ case 238 /* Block */:
9590
+ case 176 /* CallSignature */:
9591
+ case 266 /* CaseBlock */:
9592
+ case 295 /* CatchClause */:
9593
+ case 172 /* ClassStaticBlockDeclaration */:
9594
+ case 191 /* ConditionalType */:
9595
+ case 173 /* Constructor */:
9596
+ case 182 /* ConstructorType */:
9597
+ case 177 /* ConstructSignature */:
9598
+ case 245 /* ForStatement */:
9599
+ case 246 /* ForInStatement */:
9600
+ case 247 /* ForOfStatement */:
9601
+ case 259 /* FunctionDeclaration */:
9602
+ case 215 /* FunctionExpression */:
9603
+ case 181 /* FunctionType */:
9604
+ case 174 /* GetAccessor */:
9605
+ case 178 /* IndexSignature */:
9606
+ case 341 /* JSDocCallbackTag */:
9607
+ case 343 /* JSDocEnumTag */:
9608
+ case 320 /* JSDocFunctionType */:
9609
+ case 326 /* JSDocSignature */:
9610
+ case 349 /* JSDocTypedefTag */:
9611
+ case 197 /* MappedType */:
9612
+ case 171 /* MethodDeclaration */:
9613
+ case 170 /* MethodSignature */:
9614
+ case 264 /* ModuleDeclaration */:
9615
+ case 175 /* SetAccessor */:
9616
+ case 308 /* SourceFile */:
9617
+ case 262 /* TypeAliasDeclaration */:
9618
+ return true;
9619
+ default:
9620
+ return false;
9621
+ }
9622
+ }
9500
9623
  function isDeclarationKind(kind) {
9501
- return kind === 216 /* ArrowFunction */ || kind === 205 /* BindingElement */ || kind === 260 /* ClassDeclaration */ || kind === 228 /* ClassExpression */ || kind === 172 /* ClassStaticBlockDeclaration */ || kind === 173 /* Constructor */ || kind === 263 /* EnumDeclaration */ || kind === 302 /* EnumMember */ || kind === 278 /* ExportSpecifier */ || kind === 259 /* FunctionDeclaration */ || kind === 215 /* FunctionExpression */ || kind === 174 /* GetAccessor */ || kind === 270 /* ImportClause */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 273 /* ImportSpecifier */ || kind === 261 /* InterfaceDeclaration */ || kind === 288 /* JsxAttribute */ || kind === 171 /* MethodDeclaration */ || kind === 170 /* MethodSignature */ || kind === 264 /* ModuleDeclaration */ || kind === 267 /* NamespaceExportDeclaration */ || kind === 271 /* NamespaceImport */ || kind === 277 /* NamespaceExport */ || kind === 166 /* Parameter */ || kind === 299 /* PropertyAssignment */ || kind === 169 /* PropertyDeclaration */ || kind === 168 /* PropertySignature */ || kind === 175 /* SetAccessor */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 262 /* TypeAliasDeclaration */ || kind === 165 /* TypeParameter */ || kind === 257 /* VariableDeclaration */ || kind === 348 /* JSDocTypedefTag */ || kind === 341 /* JSDocCallbackTag */ || kind === 350 /* JSDocPropertyTag */;
9624
+ return kind === 216 /* ArrowFunction */ || kind === 205 /* BindingElement */ || kind === 260 /* ClassDeclaration */ || kind === 228 /* ClassExpression */ || kind === 172 /* ClassStaticBlockDeclaration */ || kind === 173 /* Constructor */ || kind === 263 /* EnumDeclaration */ || kind === 302 /* EnumMember */ || kind === 278 /* ExportSpecifier */ || kind === 259 /* FunctionDeclaration */ || kind === 215 /* FunctionExpression */ || kind === 174 /* GetAccessor */ || kind === 270 /* ImportClause */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 273 /* ImportSpecifier */ || kind === 261 /* InterfaceDeclaration */ || kind === 288 /* JsxAttribute */ || kind === 171 /* MethodDeclaration */ || kind === 170 /* MethodSignature */ || kind === 264 /* ModuleDeclaration */ || kind === 267 /* NamespaceExportDeclaration */ || kind === 271 /* NamespaceImport */ || kind === 277 /* NamespaceExport */ || kind === 166 /* Parameter */ || kind === 299 /* PropertyAssignment */ || kind === 169 /* PropertyDeclaration */ || kind === 168 /* PropertySignature */ || kind === 175 /* SetAccessor */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 262 /* TypeAliasDeclaration */ || kind === 165 /* TypeParameter */ || kind === 257 /* VariableDeclaration */ || kind === 349 /* JSDocTypedefTag */ || kind === 341 /* JSDocCallbackTag */ || kind === 351 /* JSDocPropertyTag */;
9502
9625
  }
9503
9626
  function isDeclarationStatementKind(kind) {
9504
9627
  return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */;
9505
9628
  }
9506
9629
  function isStatementKindButNotDeclarationKind(kind) {
9507
- return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 352 /* NotEmittedStatement */ || kind === 356 /* EndOfDeclarationMarker */ || kind === 355 /* MergeDeclarationMarker */;
9630
+ return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 354 /* NotEmittedStatement */ || kind === 358 /* EndOfDeclarationMarker */ || kind === 357 /* MergeDeclarationMarker */;
9508
9631
  }
9509
9632
  function isDeclaration(node) {
9510
9633
  if (node.kind === 165 /* TypeParameter */) {
9511
- return node.parent && node.parent.kind !== 347 /* JSDocTemplateTag */ || isInJSFile(node);
9634
+ return node.parent && node.parent.kind !== 348 /* JSDocTemplateTag */ || isInJSFile(node);
9512
9635
  }
9513
9636
  return isDeclarationKind(node.kind);
9514
9637
  }
@@ -9561,9 +9684,11 @@ function isCaseOrDefaultClause(node) {
9561
9684
  return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */;
9562
9685
  }
9563
9686
  function isJSDocNode(node) {
9564
- return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 350 /* LastJSDocNode */;
9687
+ return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 352 /* LastJSDocNode */;
9565
9688
  }
9566
9689
  function hasJSDocNodes(node) {
9690
+ if (!canHaveJSDoc(node))
9691
+ return false;
9567
9692
  const { jsDoc } = node;
9568
9693
  return !!jsDoc && jsDoc.length > 0;
9569
9694
  }
@@ -9613,11 +9738,7 @@ function createSingleLineStringWriter() {
9613
9738
  writeLine: () => str += " ",
9614
9739
  increaseIndent: noop,
9615
9740
  decreaseIndent: noop,
9616
- clear: () => str = "",
9617
- trackSymbol: () => false,
9618
- reportInaccessibleThisError: noop,
9619
- reportInaccessibleUniqueSymbolError: noop,
9620
- reportPrivateInBaseOfClassExpression: noop
9741
+ clear: () => str = ""
9621
9742
  };
9622
9743
  }
9623
9744
  function copyEntries(source, target) {
@@ -9689,7 +9810,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
9689
9810
  if (includeJsDoc && hasJSDocNodes(node)) {
9690
9811
  return getTokenPosOfNode(node.jsDoc[0], sourceFile);
9691
9812
  }
9692
- if (node.kind === 351 /* SyntaxList */ && node._children.length > 0) {
9813
+ if (node.kind === 353 /* SyntaxList */ && node._children.length > 0) {
9693
9814
  return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
9694
9815
  }
9695
9816
  return skipTrivia(
@@ -9940,7 +10061,7 @@ function isObjectLiteralOrClassExpressionMethodOrAccessor(node) {
9940
10061
  function getContainingClass(node) {
9941
10062
  return findAncestor(node.parent, isClassLike);
9942
10063
  }
9943
- function getThisContainer(node, includeArrowFunctions) {
10064
+ function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) {
9944
10065
  Debug.assert(node.kind !== 308 /* SourceFile */);
9945
10066
  while (true) {
9946
10067
  node = node.parent;
@@ -9949,10 +10070,10 @@ function getThisContainer(node, includeArrowFunctions) {
9949
10070
  }
9950
10071
  switch (node.kind) {
9951
10072
  case 164 /* ComputedPropertyName */:
9952
- if (isClassLike(node.parent.parent)) {
10073
+ if (includeClassComputedPropertyName && isClassLike(node.parent.parent)) {
9953
10074
  return node;
9954
10075
  }
9955
- node = node.parent;
10076
+ node = node.parent.parent;
9956
10077
  break;
9957
10078
  case 167 /* Decorator */:
9958
10079
  if (node.parent.kind === 166 /* Parameter */ && isClassElement(node.parent.parent)) {
@@ -9989,7 +10110,7 @@ function isInTopLevelContext(node) {
9989
10110
  if (isIdentifier(node) && (isClassDeclaration(node.parent) || isFunctionDeclaration(node.parent)) && node.parent.name === node) {
9990
10111
  node = node.parent;
9991
10112
  }
9992
- const container = getThisContainer(node, true);
10113
+ const container = getThisContainer(node, true, false);
9993
10114
  return isSourceFile(container);
9994
10115
  }
9995
10116
  function getImmediatelyInvokedFunctionExpression(func) {
@@ -10237,7 +10358,7 @@ function isJSDocConstructSignature(node) {
10237
10358
  return !!name && name.escapedText === "new";
10238
10359
  }
10239
10360
  function isJSDocTypeAlias(node) {
10240
- return node.kind === 348 /* JSDocTypedefTag */ || node.kind === 341 /* JSDocCallbackTag */ || node.kind === 342 /* JSDocEnumTag */;
10361
+ return node.kind === 349 /* JSDocTypedefTag */ || node.kind === 341 /* JSDocCallbackTag */ || node.kind === 343 /* JSDocEnumTag */;
10241
10362
  }
10242
10363
  function getSourceOfAssignment(node) {
10243
10364
  return isExpressionStatement(node) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 63 /* EqualsToken */ ? getRightMostAssignedExpression(node.expression) : void 0;
@@ -10262,6 +10383,78 @@ function getSingleVariableOfVariableStatement(node) {
10262
10383
  function getNestedModuleDeclaration(node) {
10263
10384
  return isModuleDeclaration(node) && node.body && node.body.kind === 264 /* ModuleDeclaration */ ? node.body : void 0;
10264
10385
  }
10386
+ function canHaveJSDoc(node) {
10387
+ switch (node.kind) {
10388
+ case 216 /* ArrowFunction */:
10389
+ case 223 /* BinaryExpression */:
10390
+ case 238 /* Block */:
10391
+ case 249 /* BreakStatement */:
10392
+ case 176 /* CallSignature */:
10393
+ case 292 /* CaseClause */:
10394
+ case 260 /* ClassDeclaration */:
10395
+ case 228 /* ClassExpression */:
10396
+ case 172 /* ClassStaticBlockDeclaration */:
10397
+ case 173 /* Constructor */:
10398
+ case 182 /* ConstructorType */:
10399
+ case 177 /* ConstructSignature */:
10400
+ case 248 /* ContinueStatement */:
10401
+ case 256 /* DebuggerStatement */:
10402
+ case 243 /* DoStatement */:
10403
+ case 209 /* ElementAccessExpression */:
10404
+ case 239 /* EmptyStatement */:
10405
+ case 1 /* EndOfFileToken */:
10406
+ case 263 /* EnumDeclaration */:
10407
+ case 302 /* EnumMember */:
10408
+ case 274 /* ExportAssignment */:
10409
+ case 275 /* ExportDeclaration */:
10410
+ case 278 /* ExportSpecifier */:
10411
+ case 241 /* ExpressionStatement */:
10412
+ case 246 /* ForInStatement */:
10413
+ case 247 /* ForOfStatement */:
10414
+ case 245 /* ForStatement */:
10415
+ case 259 /* FunctionDeclaration */:
10416
+ case 215 /* FunctionExpression */:
10417
+ case 181 /* FunctionType */:
10418
+ case 174 /* GetAccessor */:
10419
+ case 79 /* Identifier */:
10420
+ case 242 /* IfStatement */:
10421
+ case 269 /* ImportDeclaration */:
10422
+ case 268 /* ImportEqualsDeclaration */:
10423
+ case 178 /* IndexSignature */:
10424
+ case 261 /* InterfaceDeclaration */:
10425
+ case 320 /* JSDocFunctionType */:
10426
+ case 326 /* JSDocSignature */:
10427
+ case 253 /* LabeledStatement */:
10428
+ case 171 /* MethodDeclaration */:
10429
+ case 170 /* MethodSignature */:
10430
+ case 264 /* ModuleDeclaration */:
10431
+ case 199 /* NamedTupleMember */:
10432
+ case 267 /* NamespaceExportDeclaration */:
10433
+ case 207 /* ObjectLiteralExpression */:
10434
+ case 166 /* Parameter */:
10435
+ case 214 /* ParenthesizedExpression */:
10436
+ case 208 /* PropertyAccessExpression */:
10437
+ case 299 /* PropertyAssignment */:
10438
+ case 169 /* PropertyDeclaration */:
10439
+ case 168 /* PropertySignature */:
10440
+ case 250 /* ReturnStatement */:
10441
+ case 175 /* SetAccessor */:
10442
+ case 300 /* ShorthandPropertyAssignment */:
10443
+ case 301 /* SpreadAssignment */:
10444
+ case 252 /* SwitchStatement */:
10445
+ case 254 /* ThrowStatement */:
10446
+ case 255 /* TryStatement */:
10447
+ case 262 /* TypeAliasDeclaration */:
10448
+ case 165 /* TypeParameter */:
10449
+ case 257 /* VariableDeclaration */:
10450
+ case 240 /* VariableStatement */:
10451
+ case 244 /* WhileStatement */:
10452
+ case 251 /* WithStatement */:
10453
+ return true;
10454
+ default:
10455
+ return false;
10456
+ }
10457
+ }
10265
10458
  function getJSDocCommentsAndTags(hostNode, noCache) {
10266
10459
  let result;
10267
10460
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
@@ -10547,7 +10740,7 @@ function getOperator(expression) {
10547
10740
  }
10548
10741
  function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
10549
10742
  switch (nodeKind) {
10550
- case 354 /* CommaListExpression */:
10743
+ case 356 /* CommaListExpression */:
10551
10744
  return 0 /* Comma */;
10552
10745
  case 227 /* SpreadElement */:
10553
10746
  return 1 /* Spread */;
@@ -10952,7 +11145,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
10952
11145
  case 209 /* ElementAccessExpression */:
10953
11146
  case 208 /* PropertyAccessExpression */:
10954
11147
  case 232 /* NonNullExpression */:
10955
- case 353 /* PartiallyEmittedExpression */:
11148
+ case 355 /* PartiallyEmittedExpression */:
10956
11149
  case 235 /* SatisfiesExpression */:
10957
11150
  node = node.expression;
10958
11151
  continue;
@@ -10991,6 +11184,7 @@ function Node4(kind, pos, end) {
10991
11184
  this.transformFlags = 0 /* None */;
10992
11185
  this.parent = void 0;
10993
11186
  this.original = void 0;
11187
+ this.emitNode = void 0;
10994
11188
  }
10995
11189
  function Token(kind, pos, end) {
10996
11190
  this.pos = pos;
@@ -11000,6 +11194,7 @@ function Token(kind, pos, end) {
11000
11194
  this.flags = 0 /* None */;
11001
11195
  this.transformFlags = 0 /* None */;
11002
11196
  this.parent = void 0;
11197
+ this.emitNode = void 0;
11003
11198
  }
11004
11199
  function Identifier2(kind, pos, end) {
11005
11200
  this.pos = pos;
@@ -11010,6 +11205,7 @@ function Identifier2(kind, pos, end) {
11010
11205
  this.transformFlags = 0 /* None */;
11011
11206
  this.parent = void 0;
11012
11207
  this.original = void 0;
11208
+ this.emitNode = void 0;
11013
11209
  this.flowNode = void 0;
11014
11210
  }
11015
11211
  function SourceMapSource(fileName, text, skipTrivia2) {
@@ -11167,6 +11363,12 @@ function unreachableCodeIsError(options) {
11167
11363
  function unusedLabelIsError(options) {
11168
11364
  return options.allowUnusedLabels === false;
11169
11365
  }
11366
+ function getResolveJsonModule(compilerOptions) {
11367
+ if (compilerOptions.resolveJsonModule !== void 0) {
11368
+ return compilerOptions.resolveJsonModule;
11369
+ }
11370
+ return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
11371
+ }
11170
11372
  function shouldPreserveConstEnums(compilerOptions) {
11171
11373
  return !!(compilerOptions.preserveConstEnums || compilerOptions.isolatedModules);
11172
11374
  }
@@ -12420,6 +12622,8 @@ function createNodeFactory(flags, baseFactory2) {
12420
12622
  updateJSDocPropertyTag,
12421
12623
  createJSDocCallbackTag,
12422
12624
  updateJSDocCallbackTag,
12625
+ createJSDocOverloadTag,
12626
+ updateJSDocOverloadTag,
12423
12627
  createJSDocAugmentsTag,
12424
12628
  updateJSDocAugmentsTag,
12425
12629
  createJSDocImplementsTag,
@@ -12437,28 +12641,22 @@ function createNodeFactory(flags, baseFactory2) {
12437
12641
  createJSDocLinkPlain,
12438
12642
  updateJSDocLinkPlain,
12439
12643
  get createJSDocTypeTag() {
12440
- return getJSDocTypeLikeTagCreateFunction(346 /* JSDocTypeTag */);
12644
+ return getJSDocTypeLikeTagCreateFunction(347 /* JSDocTypeTag */);
12441
12645
  },
12442
12646
  get updateJSDocTypeTag() {
12443
- return getJSDocTypeLikeTagUpdateFunction(346 /* JSDocTypeTag */);
12647
+ return getJSDocTypeLikeTagUpdateFunction(347 /* JSDocTypeTag */);
12444
12648
  },
12445
12649
  get createJSDocReturnTag() {
12446
- return getJSDocTypeLikeTagCreateFunction(344 /* JSDocReturnTag */);
12650
+ return getJSDocTypeLikeTagCreateFunction(345 /* JSDocReturnTag */);
12447
12651
  },
12448
12652
  get updateJSDocReturnTag() {
12449
- return getJSDocTypeLikeTagUpdateFunction(344 /* JSDocReturnTag */);
12653
+ return getJSDocTypeLikeTagUpdateFunction(345 /* JSDocReturnTag */);
12450
12654
  },
12451
12655
  get createJSDocThisTag() {
12452
- return getJSDocTypeLikeTagCreateFunction(345 /* JSDocThisTag */);
12656
+ return getJSDocTypeLikeTagCreateFunction(346 /* JSDocThisTag */);
12453
12657
  },
12454
12658
  get updateJSDocThisTag() {
12455
- return getJSDocTypeLikeTagUpdateFunction(345 /* JSDocThisTag */);
12456
- },
12457
- get createJSDocEnumTag() {
12458
- return getJSDocTypeLikeTagCreateFunction(342 /* JSDocEnumTag */);
12459
- },
12460
- get updateJSDocEnumTag() {
12461
- return getJSDocTypeLikeTagUpdateFunction(342 /* JSDocEnumTag */);
12659
+ return getJSDocTypeLikeTagUpdateFunction(346 /* JSDocThisTag */);
12462
12660
  },
12463
12661
  get createJSDocAuthorTag() {
12464
12662
  return getJSDocSimpleTagCreateFunction(333 /* JSDocAuthorTag */);
@@ -12508,6 +12706,14 @@ function createNodeFactory(flags, baseFactory2) {
12508
12706
  get updateJSDocDeprecatedTag() {
12509
12707
  return getJSDocSimpleTagUpdateFunction(334 /* JSDocDeprecatedTag */);
12510
12708
  },
12709
+ get createJSDocThrowsTag() {
12710
+ return getJSDocTypeLikeTagCreateFunction(352 /* JSDocThrowsTag */);
12711
+ },
12712
+ get updateJSDocThrowsTag() {
12713
+ return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */);
12714
+ },
12715
+ createJSDocEnumTag,
12716
+ updateJSDocEnumTag,
12511
12717
  createJSDocUnknownTag,
12512
12718
  updateJSDocUnknownTag,
12513
12719
  createJSDocText,
@@ -12554,6 +12760,7 @@ function createNodeFactory(flags, baseFactory2) {
12554
12760
  updateEnumMember,
12555
12761
  createSourceFile: createSourceFile2,
12556
12762
  updateSourceFile,
12763
+ createRedirectedSourceFile,
12557
12764
  createBundle,
12558
12765
  updateBundle,
12559
12766
  createUnparsedSource,
@@ -12730,8 +12937,10 @@ function createNodeFactory(flags, baseFactory2) {
12730
12937
  }
12731
12938
  const length2 = elements.length;
12732
12939
  const array = length2 >= 1 && length2 <= 4 ? elements.slice() : elements;
12733
- setTextRangePosEnd(array, -1, -1);
12940
+ array.pos = -1;
12941
+ array.end = -1;
12734
12942
  array.hasTrailingComma = !!hasTrailingComma;
12943
+ array.transformFlags = 0 /* None */;
12735
12944
  aggregateChildrenFlags(array);
12736
12945
  Debug.attachNodeArrayDebugInfo(array);
12737
12946
  return array;
@@ -12743,61 +12952,6 @@ function createNodeFactory(flags, baseFactory2) {
12743
12952
  const node = createBaseNode(kind);
12744
12953
  node.symbol = void 0;
12745
12954
  node.localSymbol = void 0;
12746
- node.locals = void 0;
12747
- node.nextContainer = void 0;
12748
- return node;
12749
- }
12750
- function createBaseNamedDeclaration(kind, modifiers, name) {
12751
- const node = createBaseDeclaration(kind);
12752
- name = asName(name);
12753
- node.name = name;
12754
- if (canHaveModifiers(node)) {
12755
- node.modifiers = asNodeArray(modifiers);
12756
- node.transformFlags |= propagateChildrenFlags(node.modifiers);
12757
- }
12758
- if (name) {
12759
- switch (node.kind) {
12760
- case 171 /* MethodDeclaration */:
12761
- case 174 /* GetAccessor */:
12762
- case 175 /* SetAccessor */:
12763
- case 169 /* PropertyDeclaration */:
12764
- case 299 /* PropertyAssignment */:
12765
- if (isIdentifier(name)) {
12766
- node.transformFlags |= propagateIdentifierNameFlags(name);
12767
- break;
12768
- }
12769
- default:
12770
- node.transformFlags |= propagateChildFlags(name);
12771
- break;
12772
- }
12773
- }
12774
- return node;
12775
- }
12776
- function createBaseGenericNamedDeclaration(kind, modifiers, name, typeParameters) {
12777
- const node = createBaseNamedDeclaration(
12778
- kind,
12779
- modifiers,
12780
- name
12781
- );
12782
- node.typeParameters = asNodeArray(typeParameters);
12783
- node.transformFlags |= propagateChildrenFlags(node.typeParameters);
12784
- if (typeParameters)
12785
- node.transformFlags |= 1 /* ContainsTypeScript */;
12786
- return node;
12787
- }
12788
- function createBaseSignatureDeclaration(kind, modifiers, name, typeParameters, parameters, type) {
12789
- const node = createBaseGenericNamedDeclaration(
12790
- kind,
12791
- modifiers,
12792
- name,
12793
- typeParameters
12794
- );
12795
- node.parameters = createNodeArray(parameters);
12796
- node.type = type;
12797
- node.transformFlags |= propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type);
12798
- if (type)
12799
- node.transformFlags |= 1 /* ContainsTypeScript */;
12800
- node.typeArguments = void 0;
12801
12955
  return node;
12802
12956
  }
12803
12957
  function finishUpdateBaseSignatureDeclaration(updated, original) {
@@ -12806,86 +12960,23 @@ function createNodeFactory(flags, baseFactory2) {
12806
12960
  }
12807
12961
  return update(updated, original);
12808
12962
  }
12809
- function createBaseFunctionLikeDeclaration(kind, modifiers, name, typeParameters, parameters, type, body) {
12810
- const node = createBaseSignatureDeclaration(
12811
- kind,
12812
- modifiers,
12813
- name,
12814
- typeParameters,
12815
- parameters,
12816
- type
12817
- );
12818
- node.body = body;
12819
- node.transformFlags |= propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */;
12820
- if (!body)
12821
- node.transformFlags |= 1 /* ContainsTypeScript */;
12822
- return node;
12823
- }
12824
- function createBaseInterfaceOrClassLikeDeclaration(kind, modifiers, name, typeParameters, heritageClauses) {
12825
- const node = createBaseGenericNamedDeclaration(
12826
- kind,
12827
- modifiers,
12828
- name,
12829
- typeParameters
12830
- );
12831
- node.heritageClauses = asNodeArray(heritageClauses);
12832
- node.transformFlags |= propagateChildrenFlags(node.heritageClauses);
12833
- return node;
12834
- }
12835
- function createBaseClassLikeDeclaration(kind, modifiers, name, typeParameters, heritageClauses, members) {
12836
- const node = createBaseInterfaceOrClassLikeDeclaration(
12837
- kind,
12838
- modifiers,
12839
- name,
12840
- typeParameters,
12841
- heritageClauses
12842
- );
12843
- node.members = createNodeArray(members);
12844
- node.transformFlags |= propagateChildrenFlags(node.members);
12845
- return node;
12846
- }
12847
- function createBaseBindingLikeDeclaration(kind, modifiers, name, initializer) {
12848
- const node = createBaseNamedDeclaration(
12849
- kind,
12850
- modifiers,
12851
- name
12852
- );
12853
- node.initializer = initializer;
12854
- node.transformFlags |= propagateChildFlags(node.initializer);
12855
- return node;
12856
- }
12857
- function createBaseVariableLikeDeclaration(kind, modifiers, name, type, initializer) {
12858
- const node = createBaseBindingLikeDeclaration(
12859
- kind,
12860
- modifiers,
12861
- name,
12862
- initializer
12863
- );
12864
- node.type = type;
12865
- node.transformFlags |= propagateChildFlags(type);
12866
- if (type)
12867
- node.transformFlags |= 1 /* ContainsTypeScript */;
12868
- return node;
12869
- }
12870
- function createBaseLiteral(kind, text) {
12871
- const node = createBaseToken(kind);
12872
- node.text = text;
12873
- return node;
12874
- }
12875
12963
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
12876
- const node = createBaseLiteral(8 /* NumericLiteral */, typeof value === "number" ? value + "" : value);
12964
+ const node = createBaseDeclaration(8 /* NumericLiteral */);
12965
+ node.text = typeof value === "number" ? value + "" : value;
12877
12966
  node.numericLiteralFlags = numericLiteralFlags;
12878
12967
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
12879
12968
  node.transformFlags |= 1024 /* ContainsES2015 */;
12880
12969
  return node;
12881
12970
  }
12882
12971
  function createBigIntLiteral(value) {
12883
- const node = createBaseLiteral(9 /* BigIntLiteral */, typeof value === "string" ? value : pseudoBigIntToString(value) + "n");
12972
+ const node = createBaseToken(9 /* BigIntLiteral */);
12973
+ node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n";
12884
12974
  node.transformFlags |= 4 /* ContainsESNext */;
12885
12975
  return node;
12886
12976
  }
12887
12977
  function createBaseStringLiteral(text, isSingleQuote) {
12888
- const node = createBaseLiteral(10 /* StringLiteral */, text);
12978
+ const node = createBaseDeclaration(10 /* StringLiteral */);
12979
+ node.text = text;
12889
12980
  node.singleQuote = isSingleQuote;
12890
12981
  return node;
12891
12982
  }
@@ -12902,7 +12993,8 @@ function createNodeFactory(flags, baseFactory2) {
12902
12993
  return node;
12903
12994
  }
12904
12995
  function createRegularExpressionLiteral(text) {
12905
- const node = createBaseLiteral(13 /* RegularExpressionLiteral */, text);
12996
+ const node = createBaseToken(13 /* RegularExpressionLiteral */);
12997
+ node.text = text;
12906
12998
  return node;
12907
12999
  }
12908
13000
  function createLiteralLikeNode(kind, text) {
@@ -12923,20 +13015,15 @@ function createNodeFactory(flags, baseFactory2) {
12923
13015
  return createTemplateLiteralLikeNode(kind, text, void 0, 0);
12924
13016
  }
12925
13017
  }
12926
- function createBaseIdentifier(text, originalKeywordKind) {
12927
- if (originalKeywordKind === void 0 && text) {
12928
- originalKeywordKind = stringToToken(text);
12929
- }
12930
- if (originalKeywordKind === 79 /* Identifier */) {
12931
- originalKeywordKind = void 0;
12932
- }
13018
+ function createBaseIdentifier(escapedText, originalKeywordKind) {
12933
13019
  const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
12934
13020
  node.originalKeywordKind = originalKeywordKind;
12935
- node.escapedText = escapeLeadingUnderscores(text);
13021
+ node.escapedText = escapedText;
13022
+ node.autoGenerateFlags = 0 /* None */;
12936
13023
  return node;
12937
13024
  }
12938
13025
  function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
12939
- const node = createBaseIdentifier(text, void 0);
13026
+ const node = createBaseIdentifier(escapeLeadingUnderscores(text), void 0);
12940
13027
  node.autoGenerateFlags = autoGenerateFlags;
12941
13028
  node.autoGenerateId = nextAutoGenerateId;
12942
13029
  node.autoGeneratePrefix = prefix;
@@ -12945,15 +13032,23 @@ function createNodeFactory(flags, baseFactory2) {
12945
13032
  return node;
12946
13033
  }
12947
13034
  function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
12948
- const node = createBaseIdentifier(text, originalKeywordKind);
12949
- if (typeArguments) {
12950
- node.typeArguments = createNodeArray(typeArguments);
13035
+ if (originalKeywordKind === void 0 && text) {
13036
+ originalKeywordKind = stringToToken(text);
13037
+ }
13038
+ if (originalKeywordKind === 79 /* Identifier */) {
13039
+ originalKeywordKind = void 0;
12951
13040
  }
13041
+ const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind);
13042
+ node.typeArguments = asNodeArray(typeArguments);
13043
+ node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
13044
+ node.jsDoc = void 0;
13045
+ node.jsDocCache = void 0;
13046
+ node.flowNode = void 0;
13047
+ node.symbol = void 0;
12952
13048
  if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
12953
13049
  node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
12954
13050
  }
12955
- if (hasExtendedUnicodeEscape) {
12956
- node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
13051
+ if (node.hasExtendedUnicodeEscape) {
12957
13052
  node.transformFlags |= 1024 /* ContainsES2015 */;
12958
13053
  }
12959
13054
  return node;
@@ -12991,19 +13086,20 @@ function createNodeFactory(flags, baseFactory2) {
12991
13086
  name.original = node;
12992
13087
  return name;
12993
13088
  }
12994
- function createBasePrivateIdentifier(text) {
13089
+ function createBasePrivateIdentifier(escapedText) {
12995
13090
  const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
12996
- node.escapedText = escapeLeadingUnderscores(text);
13091
+ node.escapedText = escapedText;
13092
+ node.autoGenerateFlags = 0 /* None */;
12997
13093
  node.transformFlags |= 16777216 /* ContainsClassFields */;
12998
13094
  return node;
12999
13095
  }
13000
13096
  function createPrivateIdentifier(text) {
13001
13097
  if (!startsWith(text, "#"))
13002
13098
  Debug.fail("First character of private identifier must be #: " + text);
13003
- return createBasePrivateIdentifier(text);
13099
+ return createBasePrivateIdentifier(escapeLeadingUnderscores(text));
13004
13100
  }
13005
13101
  function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
13006
- const node = createBasePrivateIdentifier(text);
13102
+ const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
13007
13103
  node.autoGenerateFlags = autoGenerateFlags;
13008
13104
  node.autoGenerateId = nextAutoGenerateId;
13009
13105
  node.autoGeneratePrefix = prefix;
@@ -13063,6 +13159,7 @@ function createNodeFactory(flags, baseFactory2) {
13063
13159
  break;
13064
13160
  case 106 /* SuperKeyword */:
13065
13161
  transformFlags = 1024 /* ContainsES2015 */ | 134217728 /* ContainsLexicalSuper */;
13162
+ node.flowNode = void 0;
13066
13163
  break;
13067
13164
  case 124 /* StaticKeyword */:
13068
13165
  transformFlags = 1024 /* ContainsES2015 */;
@@ -13072,6 +13169,7 @@ function createNodeFactory(flags, baseFactory2) {
13072
13169
  break;
13073
13170
  case 108 /* ThisKeyword */:
13074
13171
  transformFlags = 16384 /* ContainsLexicalThis */;
13172
+ node.flowNode = void 0;
13075
13173
  break;
13076
13174
  }
13077
13175
  if (transformFlags) {
@@ -13136,6 +13234,7 @@ function createNodeFactory(flags, baseFactory2) {
13136
13234
  node.left = left;
13137
13235
  node.right = asName(right);
13138
13236
  node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right);
13237
+ node.flowNode = void 0;
13139
13238
  return node;
13140
13239
  }
13141
13240
  function updateQualifiedName(node, left, right) {
@@ -13151,40 +13250,36 @@ function createNodeFactory(flags, baseFactory2) {
13151
13250
  return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node;
13152
13251
  }
13153
13252
  function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) {
13154
- const node = createBaseNamedDeclaration(
13155
- 165 /* TypeParameter */,
13156
- modifiers,
13157
- name
13158
- );
13253
+ const node = createBaseDeclaration(165 /* TypeParameter */);
13254
+ node.modifiers = asNodeArray(modifiers);
13255
+ node.name = asName(name);
13159
13256
  node.constraint = constraint;
13160
13257
  node.default = defaultType;
13161
13258
  node.transformFlags = 1 /* ContainsTypeScript */;
13259
+ node.expression = void 0;
13260
+ node.jsDoc = void 0;
13261
+ node.jsDocCache = void 0;
13162
13262
  return node;
13163
13263
  }
13164
13264
  function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) {
13165
13265
  return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node) : node;
13166
13266
  }
13167
13267
  function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) {
13168
- const node = createBaseVariableLikeDeclaration(
13169
- 166 /* Parameter */,
13170
- modifiers,
13171
- name,
13172
- type,
13173
- initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
13174
- );
13268
+ var _a2, _b;
13269
+ const node = createBaseDeclaration(166 /* Parameter */);
13270
+ node.modifiers = asNodeArray(modifiers);
13175
13271
  node.dotDotDotToken = dotDotDotToken;
13272
+ node.name = asName(name);
13176
13273
  node.questionToken = questionToken;
13274
+ node.type = type;
13275
+ node.initializer = asInitializer(initializer);
13177
13276
  if (isThisIdentifier(node.name)) {
13178
13277
  node.transformFlags = 1 /* ContainsTypeScript */;
13179
13278
  } else {
13180
- node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.questionToken);
13181
- if (questionToken)
13182
- node.transformFlags |= 1 /* ContainsTypeScript */;
13183
- if (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */)
13184
- node.transformFlags |= 8192 /* ContainsTypeScriptClassSyntax */;
13185
- if (initializer || dotDotDotToken)
13186
- node.transformFlags |= 1024 /* ContainsES2015 */;
13279
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (((_a2 = node.questionToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */) | (((_b = node.dotDotDotToken) != null ? _b : node.initializer) ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */);
13187
13280
  }
13281
+ node.jsDoc = void 0;
13282
+ node.jsDocCache = void 0;
13188
13283
  return node;
13189
13284
  }
13190
13285
  function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
@@ -13200,15 +13295,15 @@ function createNodeFactory(flags, baseFactory2) {
13200
13295
  return node.expression !== expression ? update(createDecorator(expression), node) : node;
13201
13296
  }
13202
13297
  function createPropertySignature(modifiers, name, questionToken, type) {
13203
- const node = createBaseNamedDeclaration(
13204
- 168 /* PropertySignature */,
13205
- modifiers,
13206
- name
13207
- );
13298
+ const node = createBaseDeclaration(168 /* PropertySignature */);
13299
+ node.modifiers = asNodeArray(modifiers);
13300
+ node.name = asName(name);
13208
13301
  node.type = type;
13209
13302
  node.questionToken = questionToken;
13210
13303
  node.transformFlags = 1 /* ContainsTypeScript */;
13211
13304
  node.initializer = void 0;
13305
+ node.jsDoc = void 0;
13306
+ node.jsDocCache = void 0;
13212
13307
  return node;
13213
13308
  }
13214
13309
  function updatePropertySignature(node, modifiers, name, questionToken, type) {
@@ -13221,69 +13316,68 @@ function createNodeFactory(flags, baseFactory2) {
13221
13316
  return update(updated, original);
13222
13317
  }
13223
13318
  function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) {
13224
- const node = createBaseVariableLikeDeclaration(
13225
- 169 /* PropertyDeclaration */,
13226
- modifiers,
13227
- name,
13228
- type,
13229
- initializer
13230
- );
13319
+ const node = createBaseDeclaration(169 /* PropertyDeclaration */);
13320
+ node.modifiers = asNodeArray(modifiers);
13321
+ node.name = asName(name);
13231
13322
  node.questionToken = questionOrExclamationToken && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0;
13232
13323
  node.exclamationToken = questionOrExclamationToken && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0;
13233
- node.transformFlags |= propagateChildFlags(node.questionToken) | propagateChildFlags(node.exclamationToken) | 16777216 /* ContainsClassFields */;
13234
- if (isComputedPropertyName(node.name) || hasStaticModifier(node) && node.initializer) {
13235
- node.transformFlags |= 8192 /* ContainsTypeScriptClassSyntax */;
13236
- }
13237
- if (questionOrExclamationToken || modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
13238
- node.transformFlags |= 1 /* ContainsTypeScript */;
13239
- }
13324
+ node.type = type;
13325
+ node.initializer = asInitializer(initializer);
13326
+ const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */;
13327
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 32 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */;
13328
+ node.jsDoc = void 0;
13329
+ node.jsDocCache = void 0;
13240
13330
  return node;
13241
13331
  }
13242
13332
  function updatePropertyDeclaration(node, modifiers, name, questionOrExclamationToken, type, initializer) {
13243
13333
  return node.modifiers !== modifiers || node.name !== name || node.questionToken !== (questionOrExclamationToken !== void 0 && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type || node.initializer !== initializer ? update(createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer), node) : node;
13244
13334
  }
13245
13335
  function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) {
13246
- const node = createBaseSignatureDeclaration(
13247
- 170 /* MethodSignature */,
13248
- modifiers,
13249
- name,
13250
- typeParameters,
13251
- parameters,
13252
- type
13253
- );
13336
+ const node = createBaseDeclaration(170 /* MethodSignature */);
13337
+ node.modifiers = asNodeArray(modifiers);
13338
+ node.name = asName(name);
13254
13339
  node.questionToken = questionToken;
13340
+ node.typeParameters = asNodeArray(typeParameters);
13341
+ node.parameters = asNodeArray(parameters);
13342
+ node.type = type;
13255
13343
  node.transformFlags = 1 /* ContainsTypeScript */;
13344
+ node.jsDoc = void 0;
13345
+ node.jsDocCache = void 0;
13346
+ node.locals = void 0;
13347
+ node.nextContainer = void 0;
13348
+ node.typeArguments = void 0;
13256
13349
  return node;
13257
13350
  }
13258
13351
  function updateMethodSignature(node, modifiers, name, questionToken, typeParameters, parameters, type) {
13259
13352
  return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type), node) : node;
13260
13353
  }
13261
13354
  function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
13262
- const node = createBaseFunctionLikeDeclaration(
13263
- 171 /* MethodDeclaration */,
13264
- modifiers,
13265
- name,
13266
- typeParameters,
13267
- parameters,
13268
- type,
13269
- body
13270
- );
13355
+ const node = createBaseDeclaration(171 /* MethodDeclaration */);
13356
+ node.modifiers = asNodeArray(modifiers);
13271
13357
  node.asteriskToken = asteriskToken;
13358
+ node.name = asName(name);
13272
13359
  node.questionToken = questionToken;
13273
- node.transformFlags |= propagateChildFlags(node.asteriskToken) | propagateChildFlags(node.questionToken) | 1024 /* ContainsES2015 */;
13274
- if (questionToken) {
13275
- node.transformFlags |= 1 /* ContainsTypeScript */;
13276
- }
13277
- if (modifiersToFlags(node.modifiers) & 512 /* Async */) {
13278
- if (asteriskToken) {
13279
- node.transformFlags |= 128 /* ContainsES2018 */;
13280
- } else {
13281
- node.transformFlags |= 256 /* ContainsES2017 */;
13282
- }
13283
- } else if (asteriskToken) {
13284
- node.transformFlags |= 2048 /* ContainsGenerator */;
13285
- }
13286
13360
  node.exclamationToken = void 0;
13361
+ node.typeParameters = asNodeArray(typeParameters);
13362
+ node.parameters = createNodeArray(parameters);
13363
+ node.type = type;
13364
+ node.body = body;
13365
+ if (!node.body) {
13366
+ node.transformFlags = 1 /* ContainsTypeScript */;
13367
+ } else {
13368
+ const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */;
13369
+ const isGenerator = !!node.asteriskToken;
13370
+ const isAsyncGenerator = isAsync && isGenerator;
13371
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.questionToken || node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */;
13372
+ }
13373
+ node.typeArguments = void 0;
13374
+ node.jsDoc = void 0;
13375
+ node.jsDocCache = void 0;
13376
+ node.locals = void 0;
13377
+ node.nextContainer = void 0;
13378
+ node.flowNode = void 0;
13379
+ node.endFlowNode = void 0;
13380
+ node.returnFlowNode = void 0;
13287
13381
  return node;
13288
13382
  }
13289
13383
  function updateMethodDeclaration(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
@@ -13296,16 +13390,17 @@ function createNodeFactory(flags, baseFactory2) {
13296
13390
  return update(updated, original);
13297
13391
  }
13298
13392
  function createClassStaticBlockDeclaration(body) {
13299
- const node = createBaseGenericNamedDeclaration(
13300
- 172 /* ClassStaticBlockDeclaration */,
13301
- void 0,
13302
- void 0,
13303
- void 0
13304
- );
13393
+ const node = createBaseDeclaration(172 /* ClassStaticBlockDeclaration */);
13305
13394
  node.body = body;
13306
13395
  node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */;
13307
13396
  node.illegalDecorators = void 0;
13308
13397
  node.modifiers = void 0;
13398
+ node.jsDoc = void 0;
13399
+ node.jsDocCache = void 0;
13400
+ node.locals = void 0;
13401
+ node.nextContainer = void 0;
13402
+ node.endFlowNode = void 0;
13403
+ node.returnFlowNode = void 0;
13309
13404
  return node;
13310
13405
  }
13311
13406
  function updateClassStaticBlockDeclaration(node, body) {
@@ -13319,19 +13414,21 @@ function createNodeFactory(flags, baseFactory2) {
13319
13414
  return update(updated, original);
13320
13415
  }
13321
13416
  function createConstructorDeclaration(modifiers, parameters, body) {
13322
- const node = createBaseFunctionLikeDeclaration(
13323
- 173 /* Constructor */,
13324
- modifiers,
13325
- void 0,
13326
- void 0,
13327
- parameters,
13328
- void 0,
13329
- body
13330
- );
13331
- node.transformFlags |= 1024 /* ContainsES2015 */;
13417
+ const node = createBaseDeclaration(173 /* Constructor */);
13418
+ node.modifiers = asNodeArray(modifiers);
13419
+ node.parameters = createNodeArray(parameters);
13420
+ node.body = body;
13421
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | 1024 /* ContainsES2015 */;
13332
13422
  node.illegalDecorators = void 0;
13333
13423
  node.typeParameters = void 0;
13334
13424
  node.type = void 0;
13425
+ node.typeArguments = void 0;
13426
+ node.jsDoc = void 0;
13427
+ node.jsDocCache = void 0;
13428
+ node.locals = void 0;
13429
+ node.nextContainer = void 0;
13430
+ node.endFlowNode = void 0;
13431
+ node.returnFlowNode = void 0;
13335
13432
  return node;
13336
13433
  }
13337
13434
  function updateConstructorDeclaration(node, modifiers, parameters, body) {
@@ -13346,16 +13443,26 @@ function createNodeFactory(flags, baseFactory2) {
13346
13443
  return finishUpdateBaseSignatureDeclaration(updated, original);
13347
13444
  }
13348
13445
  function createGetAccessorDeclaration(modifiers, name, parameters, type, body) {
13349
- const node = createBaseFunctionLikeDeclaration(
13350
- 174 /* GetAccessor */,
13351
- modifiers,
13352
- name,
13353
- void 0,
13354
- parameters,
13355
- type,
13356
- body
13357
- );
13446
+ const node = createBaseDeclaration(174 /* GetAccessor */);
13447
+ node.modifiers = asNodeArray(modifiers);
13448
+ node.name = asName(name);
13449
+ node.parameters = createNodeArray(parameters);
13450
+ node.type = type;
13451
+ node.body = body;
13452
+ if (!node.body) {
13453
+ node.transformFlags = 1 /* ContainsTypeScript */;
13454
+ } else {
13455
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */);
13456
+ }
13457
+ node.typeArguments = void 0;
13358
13458
  node.typeParameters = void 0;
13459
+ node.jsDoc = void 0;
13460
+ node.jsDocCache = void 0;
13461
+ node.locals = void 0;
13462
+ node.nextContainer = void 0;
13463
+ node.flowNode = void 0;
13464
+ node.endFlowNode = void 0;
13465
+ node.returnFlowNode = void 0;
13359
13466
  return node;
13360
13467
  }
13361
13468
  function updateGetAccessorDeclaration(node, modifiers, name, parameters, type, body) {
@@ -13368,17 +13475,26 @@ function createNodeFactory(flags, baseFactory2) {
13368
13475
  return finishUpdateBaseSignatureDeclaration(updated, original);
13369
13476
  }
13370
13477
  function createSetAccessorDeclaration(modifiers, name, parameters, body) {
13371
- const node = createBaseFunctionLikeDeclaration(
13372
- 175 /* SetAccessor */,
13373
- modifiers,
13374
- name,
13375
- void 0,
13376
- parameters,
13377
- void 0,
13378
- body
13379
- );
13478
+ const node = createBaseDeclaration(175 /* SetAccessor */);
13479
+ node.modifiers = asNodeArray(modifiers);
13480
+ node.name = asName(name);
13481
+ node.parameters = createNodeArray(parameters);
13482
+ node.body = body;
13483
+ if (!node.body) {
13484
+ node.transformFlags = 1 /* ContainsTypeScript */;
13485
+ } else {
13486
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */);
13487
+ }
13488
+ node.typeArguments = void 0;
13380
13489
  node.typeParameters = void 0;
13381
13490
  node.type = void 0;
13491
+ node.jsDoc = void 0;
13492
+ node.jsDocCache = void 0;
13493
+ node.locals = void 0;
13494
+ node.nextContainer = void 0;
13495
+ node.flowNode = void 0;
13496
+ node.endFlowNode = void 0;
13497
+ node.returnFlowNode = void 0;
13382
13498
  return node;
13383
13499
  }
13384
13500
  function updateSetAccessorDeclaration(node, modifiers, name, parameters, body) {
@@ -13392,45 +13508,49 @@ function createNodeFactory(flags, baseFactory2) {
13392
13508
  return finishUpdateBaseSignatureDeclaration(updated, original);
13393
13509
  }
13394
13510
  function createCallSignature(typeParameters, parameters, type) {
13395
- const node = createBaseSignatureDeclaration(
13396
- 176 /* CallSignature */,
13397
- void 0,
13398
- void 0,
13399
- typeParameters,
13400
- parameters,
13401
- type
13402
- );
13511
+ const node = createBaseDeclaration(176 /* CallSignature */);
13512
+ node.typeParameters = asNodeArray(typeParameters);
13513
+ node.parameters = asNodeArray(parameters);
13514
+ node.type = type;
13403
13515
  node.transformFlags = 1 /* ContainsTypeScript */;
13516
+ node.jsDoc = void 0;
13517
+ node.jsDocCache = void 0;
13518
+ node.locals = void 0;
13519
+ node.nextContainer = void 0;
13520
+ node.typeArguments = void 0;
13404
13521
  return node;
13405
13522
  }
13406
13523
  function updateCallSignature(node, typeParameters, parameters, type) {
13407
13524
  return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node) : node;
13408
13525
  }
13409
13526
  function createConstructSignature(typeParameters, parameters, type) {
13410
- const node = createBaseSignatureDeclaration(
13411
- 177 /* ConstructSignature */,
13412
- void 0,
13413
- void 0,
13414
- typeParameters,
13415
- parameters,
13416
- type
13417
- );
13527
+ const node = createBaseDeclaration(177 /* ConstructSignature */);
13528
+ node.typeParameters = asNodeArray(typeParameters);
13529
+ node.parameters = asNodeArray(parameters);
13530
+ node.type = type;
13418
13531
  node.transformFlags = 1 /* ContainsTypeScript */;
13532
+ node.jsDoc = void 0;
13533
+ node.jsDocCache = void 0;
13534
+ node.locals = void 0;
13535
+ node.nextContainer = void 0;
13536
+ node.typeArguments = void 0;
13419
13537
  return node;
13420
13538
  }
13421
13539
  function updateConstructSignature(node, typeParameters, parameters, type) {
13422
13540
  return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node) : node;
13423
13541
  }
13424
13542
  function createIndexSignature(modifiers, parameters, type) {
13425
- const node = createBaseSignatureDeclaration(
13426
- 178 /* IndexSignature */,
13427
- modifiers,
13428
- void 0,
13429
- void 0,
13430
- parameters,
13431
- type
13432
- );
13543
+ const node = createBaseDeclaration(178 /* IndexSignature */);
13544
+ node.modifiers = asNodeArray(modifiers);
13545
+ node.parameters = asNodeArray(parameters);
13546
+ node.type = type;
13433
13547
  node.transformFlags = 1 /* ContainsTypeScript */;
13548
+ node.illegalDecorators = void 0;
13549
+ node.jsDoc = void 0;
13550
+ node.jsDocCache = void 0;
13551
+ node.locals = void 0;
13552
+ node.nextContainer = void 0;
13553
+ node.typeArguments = void 0;
13434
13554
  return node;
13435
13555
  }
13436
13556
  function updateIndexSignature(node, modifiers, parameters, type) {
@@ -13471,16 +13591,17 @@ function createNodeFactory(flags, baseFactory2) {
13471
13591
  return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node;
13472
13592
  }
13473
13593
  function createFunctionTypeNode(typeParameters, parameters, type) {
13474
- const node = createBaseSignatureDeclaration(
13475
- 181 /* FunctionType */,
13476
- void 0,
13477
- void 0,
13478
- typeParameters,
13479
- parameters,
13480
- type
13481
- );
13594
+ const node = createBaseDeclaration(181 /* FunctionType */);
13595
+ node.typeParameters = asNodeArray(typeParameters);
13596
+ node.parameters = asNodeArray(parameters);
13597
+ node.type = type;
13482
13598
  node.transformFlags = 1 /* ContainsTypeScript */;
13483
13599
  node.modifiers = void 0;
13600
+ node.jsDoc = void 0;
13601
+ node.jsDocCache = void 0;
13602
+ node.locals = void 0;
13603
+ node.nextContainer = void 0;
13604
+ node.typeArguments = void 0;
13484
13605
  return node;
13485
13606
  }
13486
13607
  function updateFunctionTypeNode(node, typeParameters, parameters, type) {
@@ -13496,15 +13617,17 @@ function createNodeFactory(flags, baseFactory2) {
13496
13617
  return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified.");
13497
13618
  }
13498
13619
  function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) {
13499
- const node = createBaseSignatureDeclaration(
13500
- 182 /* ConstructorType */,
13501
- modifiers,
13502
- void 0,
13503
- typeParameters,
13504
- parameters,
13505
- type
13506
- );
13620
+ const node = createBaseDeclaration(182 /* ConstructorType */);
13621
+ node.modifiers = asNodeArray(modifiers);
13622
+ node.typeParameters = asNodeArray(typeParameters);
13623
+ node.parameters = asNodeArray(parameters);
13624
+ node.type = type;
13507
13625
  node.transformFlags = 1 /* ContainsTypeScript */;
13626
+ node.jsDoc = void 0;
13627
+ node.jsDocCache = void 0;
13628
+ node.locals = void 0;
13629
+ node.nextContainer = void 0;
13630
+ node.typeArguments = void 0;
13508
13631
  return node;
13509
13632
  }
13510
13633
  function createConstructorTypeNode2(typeParameters, parameters, type) {
@@ -13530,7 +13653,7 @@ function createNodeFactory(flags, baseFactory2) {
13530
13653
  return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node;
13531
13654
  }
13532
13655
  function createTypeLiteralNode(members) {
13533
- const node = createBaseNode(184 /* TypeLiteral */);
13656
+ const node = createBaseDeclaration(184 /* TypeLiteral */);
13534
13657
  node.members = createNodeArray(members);
13535
13658
  node.transformFlags = 1 /* ContainsTypeScript */;
13536
13659
  return node;
@@ -13557,12 +13680,14 @@ function createNodeFactory(flags, baseFactory2) {
13557
13680
  return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node;
13558
13681
  }
13559
13682
  function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {
13560
- const node = createBaseNode(199 /* NamedTupleMember */);
13683
+ const node = createBaseDeclaration(199 /* NamedTupleMember */);
13561
13684
  node.dotDotDotToken = dotDotDotToken;
13562
13685
  node.name = name;
13563
13686
  node.questionToken = questionToken;
13564
13687
  node.type = type;
13565
13688
  node.transformFlags = 1 /* ContainsTypeScript */;
13689
+ node.jsDoc = void 0;
13690
+ node.jsDocCache = void 0;
13566
13691
  return node;
13567
13692
  }
13568
13693
  function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) {
@@ -13614,6 +13739,8 @@ function createNodeFactory(flags, baseFactory2) {
13614
13739
  node.trueType = trueType;
13615
13740
  node.falseType = falseType;
13616
13741
  node.transformFlags = 1 /* ContainsTypeScript */;
13742
+ node.locals = void 0;
13743
+ node.nextContainer = void 0;
13617
13744
  return node;
13618
13745
  }
13619
13746
  function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) {
@@ -13686,7 +13813,7 @@ function createNodeFactory(flags, baseFactory2) {
13686
13813
  return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node;
13687
13814
  }
13688
13815
  function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) {
13689
- const node = createBaseNode(197 /* MappedType */);
13816
+ const node = createBaseDeclaration(197 /* MappedType */);
13690
13817
  node.readonlyToken = readonlyToken;
13691
13818
  node.typeParameter = typeParameter;
13692
13819
  node.nameType = nameType;
@@ -13694,6 +13821,8 @@ function createNodeFactory(flags, baseFactory2) {
13694
13821
  node.type = type;
13695
13822
  node.members = members && createNodeArray(members);
13696
13823
  node.transformFlags = 1 /* ContainsTypeScript */;
13824
+ node.locals = void 0;
13825
+ node.nextContainer = void 0;
13697
13826
  return node;
13698
13827
  }
13699
13828
  function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type, members) {
@@ -13730,31 +13859,20 @@ function createNodeFactory(flags, baseFactory2) {
13730
13859
  return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node;
13731
13860
  }
13732
13861
  function createBindingElement(dotDotDotToken, propertyName, name, initializer) {
13733
- const node = createBaseBindingLikeDeclaration(
13734
- 205 /* BindingElement */,
13735
- void 0,
13736
- name,
13737
- initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
13738
- );
13739
- node.propertyName = asName(propertyName);
13862
+ const node = createBaseDeclaration(205 /* BindingElement */);
13740
13863
  node.dotDotDotToken = dotDotDotToken;
13741
- node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | 1024 /* ContainsES2015 */;
13742
- if (node.propertyName) {
13743
- node.transformFlags |= isIdentifier(node.propertyName) ? propagateIdentifierNameFlags(node.propertyName) : propagateChildFlags(node.propertyName);
13744
- }
13745
- if (dotDotDotToken)
13746
- node.transformFlags |= 32768 /* ContainsRestOrSpread */;
13864
+ node.propertyName = asName(propertyName);
13865
+ node.name = asName(name);
13866
+ node.initializer = asInitializer(initializer);
13867
+ node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.propertyName) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (node.dotDotDotToken ? 32768 /* ContainsRestOrSpread */ : 0 /* None */) | 1024 /* ContainsES2015 */;
13868
+ node.flowNode = void 0;
13747
13869
  return node;
13748
13870
  }
13749
13871
  function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) {
13750
13872
  return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) : node;
13751
13873
  }
13752
- function createBaseExpression(kind) {
13753
- const node = createBaseNode(kind);
13754
- return node;
13755
- }
13756
13874
  function createArrayLiteralExpression(elements, multiLine) {
13757
- const node = createBaseExpression(206 /* ArrayLiteralExpression */);
13875
+ const node = createBaseNode(206 /* ArrayLiteralExpression */);
13758
13876
  const lastElement = elements && lastOrUndefined(elements);
13759
13877
  const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0);
13760
13878
  node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray);
@@ -13766,20 +13884,34 @@ function createNodeFactory(flags, baseFactory2) {
13766
13884
  return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node;
13767
13885
  }
13768
13886
  function createObjectLiteralExpression(properties, multiLine) {
13769
- const node = createBaseExpression(207 /* ObjectLiteralExpression */);
13887
+ const node = createBaseDeclaration(207 /* ObjectLiteralExpression */);
13770
13888
  node.properties = createNodeArray(properties);
13771
13889
  node.multiLine = multiLine;
13772
13890
  node.transformFlags |= propagateChildrenFlags(node.properties);
13891
+ node.jsDoc = void 0;
13892
+ node.jsDocCache = void 0;
13773
13893
  return node;
13774
13894
  }
13775
13895
  function updateObjectLiteralExpression(node, properties) {
13776
13896
  return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node;
13777
13897
  }
13898
+ function createBasePropertyAccessExpression(expression, questionDotToken, name) {
13899
+ const node = createBaseDeclaration(208 /* PropertyAccessExpression */);
13900
+ node.expression = expression;
13901
+ node.questionDotToken = questionDotToken;
13902
+ node.name = name;
13903
+ node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
13904
+ node.jsDoc = void 0;
13905
+ node.jsDocCache = void 0;
13906
+ node.flowNode = void 0;
13907
+ return node;
13908
+ }
13778
13909
  function createPropertyAccessExpression(expression, name) {
13779
- const node = createBaseExpression(208 /* PropertyAccessExpression */);
13780
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
13781
- node.name = asName(name);
13782
- node.transformFlags = propagateChildFlags(node.expression) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
13910
+ const node = createBasePropertyAccessExpression(
13911
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false),
13912
+ void 0,
13913
+ asName(name)
13914
+ );
13783
13915
  if (isSuperKeyword(expression)) {
13784
13916
  node.transformFlags |= 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */;
13785
13917
  }
@@ -13792,23 +13924,36 @@ function createNodeFactory(flags, baseFactory2) {
13792
13924
  return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node;
13793
13925
  }
13794
13926
  function createPropertyAccessChain(expression, questionDotToken, name) {
13795
- const node = createBaseExpression(208 /* PropertyAccessExpression */);
13927
+ const node = createBasePropertyAccessExpression(
13928
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true),
13929
+ questionDotToken,
13930
+ asName(name)
13931
+ );
13796
13932
  node.flags |= 32 /* OptionalChain */;
13797
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
13798
- node.questionDotToken = questionDotToken;
13799
- node.name = asName(name);
13800
- node.transformFlags |= 32 /* ContainsES2020 */ | propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
13933
+ node.transformFlags |= 32 /* ContainsES2020 */;
13801
13934
  return node;
13802
13935
  }
13803
13936
  function updatePropertyAccessChain(node, expression, questionDotToken, name) {
13804
13937
  Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead.");
13805
13938
  return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node;
13806
13939
  }
13940
+ function createBaseElementAccessExpression(expression, questionDotToken, argumentExpression) {
13941
+ const node = createBaseDeclaration(209 /* ElementAccessExpression */);
13942
+ node.expression = expression;
13943
+ node.questionDotToken = questionDotToken;
13944
+ node.argumentExpression = argumentExpression;
13945
+ node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression);
13946
+ node.jsDoc = void 0;
13947
+ node.jsDocCache = void 0;
13948
+ node.flowNode = void 0;
13949
+ return node;
13950
+ }
13807
13951
  function createElementAccessExpression(expression, index) {
13808
- const node = createBaseExpression(209 /* ElementAccessExpression */);
13809
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
13810
- node.argumentExpression = asExpression(index);
13811
- node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.argumentExpression);
13952
+ const node = createBaseElementAccessExpression(
13953
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false),
13954
+ void 0,
13955
+ asExpression(index)
13956
+ );
13812
13957
  if (isSuperKeyword(expression)) {
13813
13958
  node.transformFlags |= 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */;
13814
13959
  }
@@ -13821,31 +13966,43 @@ function createNodeFactory(flags, baseFactory2) {
13821
13966
  return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node;
13822
13967
  }
13823
13968
  function createElementAccessChain(expression, questionDotToken, index) {
13824
- const node = createBaseExpression(209 /* ElementAccessExpression */);
13969
+ const node = createBaseElementAccessExpression(
13970
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true),
13971
+ questionDotToken,
13972
+ asExpression(index)
13973
+ );
13825
13974
  node.flags |= 32 /* OptionalChain */;
13826
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
13827
- node.questionDotToken = questionDotToken;
13828
- node.argumentExpression = asExpression(index);
13829
- node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression) | 32 /* ContainsES2020 */;
13975
+ node.transformFlags |= 32 /* ContainsES2020 */;
13830
13976
  return node;
13831
13977
  }
13832
13978
  function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) {
13833
13979
  Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead.");
13834
13980
  return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node;
13835
13981
  }
13836
- function createCallExpression(expression, typeArguments, argumentsArray) {
13837
- const node = createBaseExpression(210 /* CallExpression */);
13838
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
13839
- node.typeArguments = asNodeArray(typeArguments);
13840
- node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
13841
- node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments);
13982
+ function createBaseCallExpression(expression, questionDotToken, typeArguments, argumentsArray) {
13983
+ const node = createBaseDeclaration(210 /* CallExpression */);
13984
+ node.expression = expression;
13985
+ node.questionDotToken = questionDotToken;
13986
+ node.typeArguments = typeArguments;
13987
+ node.arguments = argumentsArray;
13988
+ node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments);
13842
13989
  if (node.typeArguments) {
13843
13990
  node.transformFlags |= 1 /* ContainsTypeScript */;
13844
13991
  }
13992
+ if (isSuperProperty(node.expression)) {
13993
+ node.transformFlags |= 16384 /* ContainsLexicalThis */;
13994
+ }
13995
+ return node;
13996
+ }
13997
+ function createCallExpression(expression, typeArguments, argumentsArray) {
13998
+ const node = createBaseCallExpression(
13999
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false),
14000
+ void 0,
14001
+ asNodeArray(typeArguments),
14002
+ parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray))
14003
+ );
13845
14004
  if (isImportKeyword(node.expression)) {
13846
14005
  node.transformFlags |= 8388608 /* ContainsDynamicImport */;
13847
- } else if (isSuperProperty(node.expression)) {
13848
- node.transformFlags |= 16384 /* ContainsLexicalThis */;
13849
14006
  }
13850
14007
  return node;
13851
14008
  }
@@ -13856,19 +14013,14 @@ function createNodeFactory(flags, baseFactory2) {
13856
14013
  return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node;
13857
14014
  }
13858
14015
  function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) {
13859
- const node = createBaseExpression(210 /* CallExpression */);
14016
+ const node = createBaseCallExpression(
14017
+ parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true),
14018
+ questionDotToken,
14019
+ asNodeArray(typeArguments),
14020
+ parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray))
14021
+ );
13860
14022
  node.flags |= 32 /* OptionalChain */;
13861
- node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
13862
- node.questionDotToken = questionDotToken;
13863
- node.typeArguments = asNodeArray(typeArguments);
13864
- node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
13865
- node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments) | 32 /* ContainsES2020 */;
13866
- if (node.typeArguments) {
13867
- node.transformFlags |= 1 /* ContainsTypeScript */;
13868
- }
13869
- if (isSuperProperty(node.expression)) {
13870
- node.transformFlags |= 16384 /* ContainsLexicalThis */;
13871
- }
14023
+ node.transformFlags |= 32 /* ContainsES2020 */;
13872
14024
  return node;
13873
14025
  }
13874
14026
  function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) {
@@ -13876,7 +14028,7 @@ function createNodeFactory(flags, baseFactory2) {
13876
14028
  return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node;
13877
14029
  }
13878
14030
  function createNewExpression(expression, typeArguments, argumentsArray) {
13879
- const node = createBaseExpression(211 /* NewExpression */);
14031
+ const node = createBaseDeclaration(211 /* NewExpression */);
13880
14032
  node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression);
13881
14033
  node.typeArguments = asNodeArray(typeArguments);
13882
14034
  node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0;
@@ -13890,7 +14042,7 @@ function createNodeFactory(flags, baseFactory2) {
13890
14042
  return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node;
13891
14043
  }
13892
14044
  function createTaggedTemplateExpression(tag, typeArguments, template) {
13893
- const node = createBaseExpression(212 /* TaggedTemplateExpression */);
14045
+ const node = createBaseNode(212 /* TaggedTemplateExpression */);
13894
14046
  node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false);
13895
14047
  node.typeArguments = asNodeArray(typeArguments);
13896
14048
  node.template = template;
@@ -13907,7 +14059,7 @@ function createNodeFactory(flags, baseFactory2) {
13907
14059
  return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node;
13908
14060
  }
13909
14061
  function createTypeAssertion(type, expression) {
13910
- const node = createBaseExpression(213 /* TypeAssertionExpression */);
14062
+ const node = createBaseNode(213 /* TypeAssertionExpression */);
13911
14063
  node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
13912
14064
  node.type = type;
13913
14065
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -13917,65 +14069,67 @@ function createNodeFactory(flags, baseFactory2) {
13917
14069
  return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node;
13918
14070
  }
13919
14071
  function createParenthesizedExpression(expression) {
13920
- const node = createBaseExpression(214 /* ParenthesizedExpression */);
14072
+ const node = createBaseNode(214 /* ParenthesizedExpression */);
13921
14073
  node.expression = expression;
13922
14074
  node.transformFlags = propagateChildFlags(node.expression);
14075
+ node.jsDoc = void 0;
14076
+ node.jsDocCache = void 0;
13923
14077
  return node;
13924
14078
  }
13925
14079
  function updateParenthesizedExpression(node, expression) {
13926
14080
  return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node;
13927
14081
  }
13928
14082
  function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
13929
- const node = createBaseFunctionLikeDeclaration(
13930
- 215 /* FunctionExpression */,
13931
- modifiers,
13932
- name,
13933
- typeParameters,
13934
- parameters,
13935
- type,
13936
- body
13937
- );
14083
+ const node = createBaseDeclaration(215 /* FunctionExpression */);
14084
+ node.modifiers = asNodeArray(modifiers);
13938
14085
  node.asteriskToken = asteriskToken;
13939
- node.transformFlags |= propagateChildFlags(node.asteriskToken);
13940
- if (node.typeParameters) {
13941
- node.transformFlags |= 1 /* ContainsTypeScript */;
13942
- }
13943
- if (modifiersToFlags(node.modifiers) & 512 /* Async */) {
13944
- if (node.asteriskToken) {
13945
- node.transformFlags |= 128 /* ContainsES2018 */;
13946
- } else {
13947
- node.transformFlags |= 256 /* ContainsES2017 */;
13948
- }
13949
- } else if (node.asteriskToken) {
13950
- node.transformFlags |= 2048 /* ContainsGenerator */;
13951
- }
14086
+ node.name = asName(name);
14087
+ node.typeParameters = asNodeArray(typeParameters);
14088
+ node.parameters = createNodeArray(parameters);
14089
+ node.type = type;
14090
+ node.body = body;
14091
+ const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */;
14092
+ const isGenerator = !!node.asteriskToken;
14093
+ const isAsyncGenerator = isAsync && isGenerator;
14094
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14095
+ node.typeArguments = void 0;
14096
+ node.jsDoc = void 0;
14097
+ node.jsDocCache = void 0;
14098
+ node.locals = void 0;
14099
+ node.nextContainer = void 0;
14100
+ node.flowNode = void 0;
14101
+ node.endFlowNode = void 0;
14102
+ node.returnFlowNode = void 0;
13952
14103
  return node;
13953
14104
  }
13954
14105
  function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
13955
14106
  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;
13956
14107
  }
13957
14108
  function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
13958
- const node = createBaseFunctionLikeDeclaration(
13959
- 216 /* ArrowFunction */,
13960
- modifiers,
13961
- void 0,
13962
- typeParameters,
13963
- parameters,
13964
- type,
13965
- parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body)
13966
- );
14109
+ const node = createBaseDeclaration(216 /* ArrowFunction */);
14110
+ node.modifiers = asNodeArray(modifiers);
14111
+ node.typeParameters = asNodeArray(typeParameters);
14112
+ node.parameters = createNodeArray(parameters);
14113
+ node.type = type;
13967
14114
  node.equalsGreaterThanToken = equalsGreaterThanToken != null ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */);
13968
- node.transformFlags |= propagateChildFlags(node.equalsGreaterThanToken) | 1024 /* ContainsES2015 */;
13969
- if (modifiersToFlags(node.modifiers) & 512 /* Async */) {
13970
- node.transformFlags |= 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */;
13971
- }
14115
+ node.body = parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body);
14116
+ const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */;
14117
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */;
14118
+ node.typeArguments = void 0;
14119
+ node.jsDoc = void 0;
14120
+ node.jsDocCache = void 0;
14121
+ node.locals = void 0;
14122
+ node.nextContainer = void 0;
14123
+ node.flowNode = void 0;
14124
+ node.endFlowNode = void 0;
14125
+ node.returnFlowNode = void 0;
13972
14126
  return node;
13973
14127
  }
13974
14128
  function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
13975
14129
  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;
13976
14130
  }
13977
14131
  function createDeleteExpression(expression) {
13978
- const node = createBaseExpression(217 /* DeleteExpression */);
14132
+ const node = createBaseNode(217 /* DeleteExpression */);
13979
14133
  node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
13980
14134
  node.transformFlags |= propagateChildFlags(node.expression);
13981
14135
  return node;
@@ -13984,7 +14138,7 @@ function createNodeFactory(flags, baseFactory2) {
13984
14138
  return node.expression !== expression ? update(createDeleteExpression(expression), node) : node;
13985
14139
  }
13986
14140
  function createTypeOfExpression(expression) {
13987
- const node = createBaseExpression(218 /* TypeOfExpression */);
14141
+ const node = createBaseNode(218 /* TypeOfExpression */);
13988
14142
  node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
13989
14143
  node.transformFlags |= propagateChildFlags(node.expression);
13990
14144
  return node;
@@ -13993,7 +14147,7 @@ function createNodeFactory(flags, baseFactory2) {
13993
14147
  return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node;
13994
14148
  }
13995
14149
  function createVoidExpression(expression) {
13996
- const node = createBaseExpression(219 /* VoidExpression */);
14150
+ const node = createBaseNode(219 /* VoidExpression */);
13997
14151
  node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
13998
14152
  node.transformFlags |= propagateChildFlags(node.expression);
13999
14153
  return node;
@@ -14002,7 +14156,7 @@ function createNodeFactory(flags, baseFactory2) {
14002
14156
  return node.expression !== expression ? update(createVoidExpression(expression), node) : node;
14003
14157
  }
14004
14158
  function createAwaitExpression(expression) {
14005
- const node = createBaseExpression(220 /* AwaitExpression */);
14159
+ const node = createBaseNode(220 /* AwaitExpression */);
14006
14160
  node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
14007
14161
  node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */;
14008
14162
  return node;
@@ -14011,7 +14165,7 @@ function createNodeFactory(flags, baseFactory2) {
14011
14165
  return node.expression !== expression ? update(createAwaitExpression(expression), node) : node;
14012
14166
  }
14013
14167
  function createPrefixUnaryExpression(operator, operand) {
14014
- const node = createBaseExpression(221 /* PrefixUnaryExpression */);
14168
+ const node = createBaseNode(221 /* PrefixUnaryExpression */);
14015
14169
  node.operator = operator;
14016
14170
  node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand);
14017
14171
  node.transformFlags |= propagateChildFlags(node.operand);
@@ -14024,7 +14178,7 @@ function createNodeFactory(flags, baseFactory2) {
14024
14178
  return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node;
14025
14179
  }
14026
14180
  function createPostfixUnaryExpression(operand, operator) {
14027
- const node = createBaseExpression(222 /* PostfixUnaryExpression */);
14181
+ const node = createBaseNode(222 /* PostfixUnaryExpression */);
14028
14182
  node.operator = operator;
14029
14183
  node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand);
14030
14184
  node.transformFlags |= propagateChildFlags(node.operand);
@@ -14037,7 +14191,7 @@ function createNodeFactory(flags, baseFactory2) {
14037
14191
  return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node;
14038
14192
  }
14039
14193
  function createBinaryExpression(left, operator, right) {
14040
- const node = createBaseExpression(223 /* BinaryExpression */);
14194
+ const node = createBaseDeclaration(223 /* BinaryExpression */);
14041
14195
  const operatorToken = asToken(operator);
14042
14196
  const operatorKind = operatorToken.kind;
14043
14197
  node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left);
@@ -14060,6 +14214,8 @@ function createNodeFactory(flags, baseFactory2) {
14060
14214
  if (operatorKind === 101 /* InKeyword */ && isPrivateIdentifier(node.left)) {
14061
14215
  node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */;
14062
14216
  }
14217
+ node.jsDoc = void 0;
14218
+ node.jsDocCache = void 0;
14063
14219
  return node;
14064
14220
  }
14065
14221
  function propagateAssignmentPatternFlags(node) {
@@ -14086,7 +14242,7 @@ function createNodeFactory(flags, baseFactory2) {
14086
14242
  return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node;
14087
14243
  }
14088
14244
  function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {
14089
- const node = createBaseExpression(224 /* ConditionalExpression */);
14245
+ const node = createBaseNode(224 /* ConditionalExpression */);
14090
14246
  node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition);
14091
14247
  node.questionToken = questionToken != null ? questionToken : createToken(57 /* QuestionToken */);
14092
14248
  node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue);
@@ -14099,7 +14255,7 @@ function createNodeFactory(flags, baseFactory2) {
14099
14255
  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;
14100
14256
  }
14101
14257
  function createTemplateExpression(head, templateSpans) {
14102
- const node = createBaseExpression(225 /* TemplateExpression */);
14258
+ const node = createBaseNode(225 /* TemplateExpression */);
14103
14259
  node.head = head;
14104
14260
  node.templateSpans = createNodeArray(templateSpans);
14105
14261
  node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */;
@@ -14108,7 +14264,7 @@ function createNodeFactory(flags, baseFactory2) {
14108
14264
  function updateTemplateExpression(node, head, templateSpans) {
14109
14265
  return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression(head, templateSpans), node) : node;
14110
14266
  }
14111
- function createTemplateLiteralLikeNodeChecked(kind, text, rawText, templateFlags = 0 /* None */) {
14267
+ function checkTemplateLiteralLikeNode(kind, text, rawText, templateFlags = 0 /* None */) {
14112
14268
  Debug.assert(!(templateFlags & ~2048 /* TemplateLiteralLikeFlags */), "Unsupported template flags.");
14113
14269
  let cooked = void 0;
14114
14270
  if (rawText !== void 0 && rawText !== text) {
@@ -14125,34 +14281,56 @@ function createNodeFactory(flags, baseFactory2) {
14125
14281
  } else if (cooked !== void 0) {
14126
14282
  Debug.assert(text === cooked, "Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");
14127
14283
  }
14128
- return createTemplateLiteralLikeNode(kind, text, rawText, templateFlags);
14284
+ return text;
14129
14285
  }
14130
- function createTemplateLiteralLikeNode(kind, text, rawText, templateFlags) {
14286
+ function getTransformFlagsOfTemplateLiteralLike(templateFlags) {
14287
+ let transformFlags = 1024 /* ContainsES2015 */;
14288
+ if (templateFlags) {
14289
+ transformFlags |= 128 /* ContainsES2018 */;
14290
+ }
14291
+ return transformFlags;
14292
+ }
14293
+ function createTemplateLiteralLikeToken(kind, text, rawText, templateFlags) {
14131
14294
  const node = createBaseToken(kind);
14132
14295
  node.text = text;
14133
14296
  node.rawText = rawText;
14134
14297
  node.templateFlags = templateFlags & 2048 /* TemplateLiteralLikeFlags */;
14135
- node.transformFlags |= 1024 /* ContainsES2015 */;
14136
- if (node.templateFlags) {
14137
- node.transformFlags |= 128 /* ContainsES2018 */;
14138
- }
14298
+ node.transformFlags = getTransformFlagsOfTemplateLiteralLike(node.templateFlags);
14299
+ return node;
14300
+ }
14301
+ function createTemplateLiteralLikeDeclaration(kind, text, rawText, templateFlags) {
14302
+ const node = createBaseDeclaration(kind);
14303
+ node.text = text;
14304
+ node.rawText = rawText;
14305
+ node.templateFlags = templateFlags & 2048 /* TemplateLiteralLikeFlags */;
14306
+ node.transformFlags = getTransformFlagsOfTemplateLiteralLike(node.templateFlags);
14139
14307
  return node;
14140
14308
  }
14309
+ function createTemplateLiteralLikeNode(kind, text, rawText, templateFlags) {
14310
+ if (kind === 14 /* NoSubstitutionTemplateLiteral */) {
14311
+ return createTemplateLiteralLikeDeclaration(kind, text, rawText, templateFlags);
14312
+ }
14313
+ return createTemplateLiteralLikeToken(kind, text, rawText, templateFlags);
14314
+ }
14141
14315
  function createTemplateHead(text, rawText, templateFlags) {
14142
- return createTemplateLiteralLikeNodeChecked(15 /* TemplateHead */, text, rawText, templateFlags);
14316
+ text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
14317
+ return createTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
14143
14318
  }
14144
14319
  function createTemplateMiddle(text, rawText, templateFlags) {
14145
- return createTemplateLiteralLikeNodeChecked(16 /* TemplateMiddle */, text, rawText, templateFlags);
14320
+ text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
14321
+ return createTemplateLiteralLikeNode(16 /* TemplateMiddle */, text, rawText, templateFlags);
14146
14322
  }
14147
14323
  function createTemplateTail(text, rawText, templateFlags) {
14148
- return createTemplateLiteralLikeNodeChecked(17 /* TemplateTail */, text, rawText, templateFlags);
14324
+ text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
14325
+ return createTemplateLiteralLikeNode(17 /* TemplateTail */, text, rawText, templateFlags);
14149
14326
  }
14150
14327
  function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) {
14151
- return createTemplateLiteralLikeNodeChecked(14 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags);
14328
+ text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
14329
+ return createTemplateLiteralLikeDeclaration(14 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags);
14152
14330
  }
14153
14331
  function createYieldExpression(asteriskToken, expression) {
14154
14332
  Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression.");
14155
- const node = createBaseExpression(226 /* YieldExpression */);
14333
+ const node = createBaseNode(226 /* YieldExpression */);
14156
14334
  node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
14157
14335
  node.asteriskToken = asteriskToken;
14158
14336
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */;
@@ -14162,7 +14340,7 @@ function createNodeFactory(flags, baseFactory2) {
14162
14340
  return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node;
14163
14341
  }
14164
14342
  function createSpreadElement(expression) {
14165
- const node = createBaseExpression(227 /* SpreadElement */);
14343
+ const node = createBaseNode(227 /* SpreadElement */);
14166
14344
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
14167
14345
  node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */;
14168
14346
  return node;
@@ -14171,22 +14349,22 @@ function createNodeFactory(flags, baseFactory2) {
14171
14349
  return node.expression !== expression ? update(createSpreadElement(expression), node) : node;
14172
14350
  }
14173
14351
  function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) {
14174
- const node = createBaseClassLikeDeclaration(
14175
- 228 /* ClassExpression */,
14176
- modifiers,
14177
- name,
14178
- typeParameters,
14179
- heritageClauses,
14180
- members
14181
- );
14182
- node.transformFlags |= 1024 /* ContainsES2015 */;
14352
+ const node = createBaseDeclaration(228 /* ClassExpression */);
14353
+ node.modifiers = asNodeArray(modifiers);
14354
+ node.name = asName(name);
14355
+ node.typeParameters = asNodeArray(typeParameters);
14356
+ node.heritageClauses = asNodeArray(heritageClauses);
14357
+ node.members = createNodeArray(members);
14358
+ node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */;
14359
+ node.jsDoc = void 0;
14360
+ node.jsDocCache = void 0;
14183
14361
  return node;
14184
14362
  }
14185
14363
  function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) {
14186
14364
  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;
14187
14365
  }
14188
14366
  function createOmittedExpression() {
14189
- return createBaseExpression(229 /* OmittedExpression */);
14367
+ return createBaseNode(229 /* OmittedExpression */);
14190
14368
  }
14191
14369
  function createExpressionWithTypeArguments(expression, typeArguments) {
14192
14370
  const node = createBaseNode(230 /* ExpressionWithTypeArguments */);
@@ -14199,7 +14377,7 @@ function createNodeFactory(flags, baseFactory2) {
14199
14377
  return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node;
14200
14378
  }
14201
14379
  function createAsExpression(expression, type) {
14202
- const node = createBaseExpression(231 /* AsExpression */);
14380
+ const node = createBaseNode(231 /* AsExpression */);
14203
14381
  node.expression = expression;
14204
14382
  node.type = type;
14205
14383
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -14209,7 +14387,7 @@ function createNodeFactory(flags, baseFactory2) {
14209
14387
  return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node;
14210
14388
  }
14211
14389
  function createNonNullExpression(expression) {
14212
- const node = createBaseExpression(232 /* NonNullExpression */);
14390
+ const node = createBaseNode(232 /* NonNullExpression */);
14213
14391
  node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
14214
14392
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
14215
14393
  return node;
@@ -14221,7 +14399,7 @@ function createNodeFactory(flags, baseFactory2) {
14221
14399
  return node.expression !== expression ? update(createNonNullExpression(expression), node) : node;
14222
14400
  }
14223
14401
  function createSatisfiesExpression(expression, type) {
14224
- const node = createBaseExpression(235 /* SatisfiesExpression */);
14402
+ const node = createBaseNode(235 /* SatisfiesExpression */);
14225
14403
  node.expression = expression;
14226
14404
  node.type = type;
14227
14405
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
@@ -14231,7 +14409,7 @@ function createNodeFactory(flags, baseFactory2) {
14231
14409
  return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node;
14232
14410
  }
14233
14411
  function createNonNullChain(expression) {
14234
- const node = createBaseExpression(232 /* NonNullExpression */);
14412
+ const node = createBaseNode(232 /* NonNullExpression */);
14235
14413
  node.flags |= 32 /* OptionalChain */;
14236
14414
  node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
14237
14415
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -14242,7 +14420,7 @@ function createNodeFactory(flags, baseFactory2) {
14242
14420
  return node.expression !== expression ? update(createNonNullChain(expression), node) : node;
14243
14421
  }
14244
14422
  function createMetaProperty(keywordToken, name) {
14245
- const node = createBaseExpression(233 /* MetaProperty */);
14423
+ const node = createBaseNode(233 /* MetaProperty */);
14246
14424
  node.keywordToken = keywordToken;
14247
14425
  node.name = name;
14248
14426
  node.transformFlags |= propagateChildFlags(node.name);
@@ -14256,6 +14434,7 @@ function createNodeFactory(flags, baseFactory2) {
14256
14434
  default:
14257
14435
  return Debug.assertNever(keywordToken);
14258
14436
  }
14437
+ node.flowNode = void 0;
14259
14438
  return node;
14260
14439
  }
14261
14440
  function updateMetaProperty(node, name) {
@@ -14281,31 +14460,45 @@ function createNodeFactory(flags, baseFactory2) {
14281
14460
  node.statements = createNodeArray(statements);
14282
14461
  node.multiLine = multiLine;
14283
14462
  node.transformFlags |= propagateChildrenFlags(node.statements);
14463
+ node.jsDoc = void 0;
14464
+ node.jsDocCache = void 0;
14465
+ node.locals = void 0;
14466
+ node.nextContainer = void 0;
14284
14467
  return node;
14285
14468
  }
14286
14469
  function updateBlock(node, statements) {
14287
14470
  return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node;
14288
14471
  }
14289
14472
  function createVariableStatement(modifiers, declarationList) {
14290
- const node = createBaseDeclaration(240 /* VariableStatement */);
14473
+ const node = createBaseNode(240 /* VariableStatement */);
14291
14474
  node.modifiers = asNodeArray(modifiers);
14292
14475
  node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
14293
14476
  node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
14294
14477
  if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
14295
14478
  node.transformFlags = 1 /* ContainsTypeScript */;
14296
14479
  }
14480
+ node.illegalDecorators = void 0;
14481
+ node.jsDoc = void 0;
14482
+ node.jsDocCache = void 0;
14483
+ node.flowNode = void 0;
14297
14484
  return node;
14298
14485
  }
14299
14486
  function updateVariableStatement(node, modifiers, declarationList) {
14300
14487
  return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node;
14301
14488
  }
14302
14489
  function createEmptyStatement() {
14303
- return createBaseNode(239 /* EmptyStatement */);
14490
+ const node = createBaseNode(239 /* EmptyStatement */);
14491
+ node.jsDoc = void 0;
14492
+ node.jsDocCache = void 0;
14493
+ return node;
14304
14494
  }
14305
14495
  function createExpressionStatement(expression) {
14306
14496
  const node = createBaseNode(241 /* ExpressionStatement */);
14307
14497
  node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
14308
14498
  node.transformFlags |= propagateChildFlags(node.expression);
14499
+ node.jsDoc = void 0;
14500
+ node.jsDocCache = void 0;
14501
+ node.flowNode = void 0;
14309
14502
  return node;
14310
14503
  }
14311
14504
  function updateExpressionStatement(node, expression) {
@@ -14317,6 +14510,9 @@ function createNodeFactory(flags, baseFactory2) {
14317
14510
  node.thenStatement = asEmbeddedStatement(thenStatement);
14318
14511
  node.elseStatement = asEmbeddedStatement(elseStatement);
14319
14512
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement);
14513
+ node.jsDoc = void 0;
14514
+ node.jsDocCache = void 0;
14515
+ node.flowNode = void 0;
14320
14516
  return node;
14321
14517
  }
14322
14518
  function updateIfStatement(node, expression, thenStatement, elseStatement) {
@@ -14327,6 +14523,9 @@ function createNodeFactory(flags, baseFactory2) {
14327
14523
  node.statement = asEmbeddedStatement(statement);
14328
14524
  node.expression = expression;
14329
14525
  node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
14526
+ node.jsDoc = void 0;
14527
+ node.jsDocCache = void 0;
14528
+ node.flowNode = void 0;
14330
14529
  return node;
14331
14530
  }
14332
14531
  function updateDoStatement(node, statement, expression) {
@@ -14337,6 +14536,9 @@ function createNodeFactory(flags, baseFactory2) {
14337
14536
  node.expression = expression;
14338
14537
  node.statement = asEmbeddedStatement(statement);
14339
14538
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
14539
+ node.jsDoc = void 0;
14540
+ node.jsDocCache = void 0;
14541
+ node.flowNode = void 0;
14340
14542
  return node;
14341
14543
  }
14342
14544
  function updateWhileStatement(node, expression, statement) {
@@ -14349,6 +14551,11 @@ function createNodeFactory(flags, baseFactory2) {
14349
14551
  node.incrementor = incrementor;
14350
14552
  node.statement = asEmbeddedStatement(statement);
14351
14553
  node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement);
14554
+ node.jsDoc = void 0;
14555
+ node.jsDocCache = void 0;
14556
+ node.locals = void 0;
14557
+ node.nextContainer = void 0;
14558
+ node.flowNode = void 0;
14352
14559
  return node;
14353
14560
  }
14354
14561
  function updateForStatement(node, initializer, condition, incrementor, statement) {
@@ -14360,6 +14567,11 @@ function createNodeFactory(flags, baseFactory2) {
14360
14567
  node.expression = expression;
14361
14568
  node.statement = asEmbeddedStatement(statement);
14362
14569
  node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
14570
+ node.jsDoc = void 0;
14571
+ node.jsDocCache = void 0;
14572
+ node.locals = void 0;
14573
+ node.nextContainer = void 0;
14574
+ node.flowNode = void 0;
14363
14575
  return node;
14364
14576
  }
14365
14577
  function updateForInStatement(node, initializer, expression, statement) {
@@ -14374,6 +14586,11 @@ function createNodeFactory(flags, baseFactory2) {
14374
14586
  node.transformFlags |= propagateChildFlags(node.awaitModifier) | propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement) | 1024 /* ContainsES2015 */;
14375
14587
  if (awaitModifier)
14376
14588
  node.transformFlags |= 128 /* ContainsES2018 */;
14589
+ node.jsDoc = void 0;
14590
+ node.jsDocCache = void 0;
14591
+ node.locals = void 0;
14592
+ node.nextContainer = void 0;
14593
+ node.flowNode = void 0;
14377
14594
  return node;
14378
14595
  }
14379
14596
  function updateForOfStatement(node, awaitModifier, initializer, expression, statement) {
@@ -14383,6 +14600,9 @@ function createNodeFactory(flags, baseFactory2) {
14383
14600
  const node = createBaseNode(248 /* ContinueStatement */);
14384
14601
  node.label = asName(label);
14385
14602
  node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14603
+ node.jsDoc = void 0;
14604
+ node.jsDocCache = void 0;
14605
+ node.flowNode = void 0;
14386
14606
  return node;
14387
14607
  }
14388
14608
  function updateContinueStatement(node, label) {
@@ -14392,6 +14612,9 @@ function createNodeFactory(flags, baseFactory2) {
14392
14612
  const node = createBaseNode(249 /* BreakStatement */);
14393
14613
  node.label = asName(label);
14394
14614
  node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14615
+ node.jsDoc = void 0;
14616
+ node.jsDocCache = void 0;
14617
+ node.flowNode = void 0;
14395
14618
  return node;
14396
14619
  }
14397
14620
  function updateBreakStatement(node, label) {
@@ -14401,6 +14624,9 @@ function createNodeFactory(flags, baseFactory2) {
14401
14624
  const node = createBaseNode(250 /* ReturnStatement */);
14402
14625
  node.expression = expression;
14403
14626
  node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14627
+ node.jsDoc = void 0;
14628
+ node.jsDocCache = void 0;
14629
+ node.flowNode = void 0;
14404
14630
  return node;
14405
14631
  }
14406
14632
  function updateReturnStatement(node, expression) {
@@ -14411,6 +14637,9 @@ function createNodeFactory(flags, baseFactory2) {
14411
14637
  node.expression = expression;
14412
14638
  node.statement = asEmbeddedStatement(statement);
14413
14639
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
14640
+ node.jsDoc = void 0;
14641
+ node.jsDocCache = void 0;
14642
+ node.flowNode = void 0;
14414
14643
  return node;
14415
14644
  }
14416
14645
  function updateWithStatement(node, expression, statement) {
@@ -14421,6 +14650,10 @@ function createNodeFactory(flags, baseFactory2) {
14421
14650
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
14422
14651
  node.caseBlock = caseBlock;
14423
14652
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
14653
+ node.jsDoc = void 0;
14654
+ node.jsDocCache = void 0;
14655
+ node.flowNode = void 0;
14656
+ node.possiblyExhaustive = false;
14424
14657
  return node;
14425
14658
  }
14426
14659
  function updateSwitchStatement(node, expression, caseBlock) {
@@ -14431,6 +14664,9 @@ function createNodeFactory(flags, baseFactory2) {
14431
14664
  node.label = asName(label);
14432
14665
  node.statement = asEmbeddedStatement(statement);
14433
14666
  node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
14667
+ node.jsDoc = void 0;
14668
+ node.jsDocCache = void 0;
14669
+ node.flowNode = void 0;
14434
14670
  return node;
14435
14671
  }
14436
14672
  function updateLabeledStatement(node, label, statement) {
@@ -14440,6 +14676,9 @@ function createNodeFactory(flags, baseFactory2) {
14440
14676
  const node = createBaseNode(254 /* ThrowStatement */);
14441
14677
  node.expression = expression;
14442
14678
  node.transformFlags |= propagateChildFlags(node.expression);
14679
+ node.jsDoc = void 0;
14680
+ node.jsDocCache = void 0;
14681
+ node.flowNode = void 0;
14443
14682
  return node;
14444
14683
  }
14445
14684
  function updateThrowStatement(node, expression) {
@@ -14451,27 +14690,31 @@ function createNodeFactory(flags, baseFactory2) {
14451
14690
  node.catchClause = catchClause;
14452
14691
  node.finallyBlock = finallyBlock;
14453
14692
  node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock);
14693
+ node.jsDoc = void 0;
14694
+ node.jsDocCache = void 0;
14695
+ node.flowNode = void 0;
14454
14696
  return node;
14455
14697
  }
14456
14698
  function updateTryStatement(node, tryBlock, catchClause, finallyBlock) {
14457
14699
  return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node;
14458
14700
  }
14459
14701
  function createDebuggerStatement() {
14460
- return createBaseNode(256 /* DebuggerStatement */);
14702
+ const node = createBaseNode(256 /* DebuggerStatement */);
14703
+ node.jsDoc = void 0;
14704
+ node.jsDocCache = void 0;
14705
+ node.flowNode = void 0;
14706
+ return node;
14461
14707
  }
14462
14708
  function createVariableDeclaration(name, exclamationToken, type, initializer) {
14463
- const node = createBaseVariableLikeDeclaration(
14464
- 257 /* VariableDeclaration */,
14465
- void 0,
14466
- name,
14467
- type,
14468
- initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
14469
- );
14709
+ var _a2;
14710
+ const node = createBaseDeclaration(257 /* VariableDeclaration */);
14711
+ node.name = asName(name);
14470
14712
  node.exclamationToken = exclamationToken;
14471
- node.transformFlags |= propagateChildFlags(node.exclamationToken);
14472
- if (exclamationToken) {
14473
- node.transformFlags |= 1 /* ContainsTypeScript */;
14474
- }
14713
+ node.type = type;
14714
+ node.initializer = asInitializer(initializer);
14715
+ node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */);
14716
+ node.jsDoc = void 0;
14717
+ node.jsDocCache = void 0;
14475
14718
  return node;
14476
14719
  }
14477
14720
  function updateVariableDeclaration(node, name, exclamationToken, type, initializer) {
@@ -14491,31 +14734,30 @@ function createNodeFactory(flags, baseFactory2) {
14491
14734
  return node.declarations !== declarations ? update(createVariableDeclarationList(declarations, node.flags), node) : node;
14492
14735
  }
14493
14736
  function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
14494
- const node = createBaseFunctionLikeDeclaration(
14495
- 259 /* FunctionDeclaration */,
14496
- modifiers,
14497
- name,
14498
- typeParameters,
14499
- parameters,
14500
- type,
14501
- body
14502
- );
14737
+ const node = createBaseDeclaration(259 /* FunctionDeclaration */);
14738
+ node.modifiers = asNodeArray(modifiers);
14503
14739
  node.asteriskToken = asteriskToken;
14740
+ node.name = asName(name);
14741
+ node.typeParameters = asNodeArray(typeParameters);
14742
+ node.parameters = createNodeArray(parameters);
14743
+ node.type = type;
14744
+ node.body = body;
14504
14745
  if (!node.body || modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
14505
14746
  node.transformFlags = 1 /* ContainsTypeScript */;
14506
14747
  } else {
14507
- node.transformFlags |= propagateChildFlags(node.asteriskToken) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14508
- if (modifiersToFlags(node.modifiers) & 512 /* Async */) {
14509
- if (node.asteriskToken) {
14510
- node.transformFlags |= 128 /* ContainsES2018 */;
14511
- } else {
14512
- node.transformFlags |= 256 /* ContainsES2017 */;
14513
- }
14514
- } else if (node.asteriskToken) {
14515
- node.transformFlags |= 2048 /* ContainsGenerator */;
14516
- }
14748
+ const isAsync = modifiersToFlags(node.modifiers) & 512 /* Async */;
14749
+ const isGenerator = !!node.asteriskToken;
14750
+ const isAsyncGenerator = isAsync && isGenerator;
14751
+ node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
14517
14752
  }
14518
14753
  node.illegalDecorators = void 0;
14754
+ node.typeArguments = void 0;
14755
+ node.jsDoc = void 0;
14756
+ node.jsDocCache = void 0;
14757
+ node.locals = void 0;
14758
+ node.nextContainer = void 0;
14759
+ node.endFlowNode = void 0;
14760
+ node.returnFlowNode = void 0;
14519
14761
  return node;
14520
14762
  }
14521
14763
  function updateFunctionDeclaration(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
@@ -14528,38 +14770,38 @@ function createNodeFactory(flags, baseFactory2) {
14528
14770
  return finishUpdateBaseSignatureDeclaration(updated, original);
14529
14771
  }
14530
14772
  function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
14531
- const node = createBaseClassLikeDeclaration(
14532
- 260 /* ClassDeclaration */,
14533
- modifiers,
14534
- name,
14535
- typeParameters,
14536
- heritageClauses,
14537
- members
14538
- );
14773
+ const node = createBaseDeclaration(260 /* ClassDeclaration */);
14774
+ node.modifiers = asNodeArray(modifiers);
14775
+ node.name = asName(name);
14776
+ node.typeParameters = asNodeArray(typeParameters);
14777
+ node.heritageClauses = asNodeArray(heritageClauses);
14778
+ node.members = createNodeArray(members);
14539
14779
  if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
14540
14780
  node.transformFlags = 1 /* ContainsTypeScript */;
14541
14781
  } else {
14542
- node.transformFlags |= 1024 /* ContainsES2015 */;
14782
+ node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */;
14543
14783
  if (node.transformFlags & 8192 /* ContainsTypeScriptClassSyntax */) {
14544
14784
  node.transformFlags |= 1 /* ContainsTypeScript */;
14545
14785
  }
14546
14786
  }
14787
+ node.jsDoc = void 0;
14788
+ node.jsDocCache = void 0;
14547
14789
  return node;
14548
14790
  }
14549
14791
  function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
14550
14792
  return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node;
14551
14793
  }
14552
14794
  function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
14553
- const node = createBaseInterfaceOrClassLikeDeclaration(
14554
- 261 /* InterfaceDeclaration */,
14555
- modifiers,
14556
- name,
14557
- typeParameters,
14558
- heritageClauses
14559
- );
14795
+ const node = createBaseDeclaration(261 /* InterfaceDeclaration */);
14796
+ node.modifiers = asNodeArray(modifiers);
14797
+ node.name = asName(name);
14798
+ node.typeParameters = asNodeArray(typeParameters);
14799
+ node.heritageClauses = asNodeArray(heritageClauses);
14560
14800
  node.members = createNodeArray(members);
14561
14801
  node.transformFlags = 1 /* ContainsTypeScript */;
14562
14802
  node.illegalDecorators = void 0;
14803
+ node.jsDoc = void 0;
14804
+ node.jsDocCache = void 0;
14563
14805
  return node;
14564
14806
  }
14565
14807
  function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -14572,15 +14814,17 @@ function createNodeFactory(flags, baseFactory2) {
14572
14814
  return update(updated, original);
14573
14815
  }
14574
14816
  function createTypeAliasDeclaration(modifiers, name, typeParameters, type) {
14575
- const node = createBaseGenericNamedDeclaration(
14576
- 262 /* TypeAliasDeclaration */,
14577
- modifiers,
14578
- name,
14579
- typeParameters
14580
- );
14817
+ const node = createBaseDeclaration(262 /* TypeAliasDeclaration */);
14818
+ node.modifiers = asNodeArray(modifiers);
14819
+ node.name = asName(name);
14820
+ node.typeParameters = asNodeArray(typeParameters);
14581
14821
  node.type = type;
14582
14822
  node.transformFlags = 1 /* ContainsTypeScript */;
14583
14823
  node.illegalDecorators = void 0;
14824
+ node.jsDoc = void 0;
14825
+ node.jsDocCache = void 0;
14826
+ node.locals = void 0;
14827
+ node.nextContainer = void 0;
14584
14828
  return node;
14585
14829
  }
14586
14830
  function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) {
@@ -14593,15 +14837,15 @@ function createNodeFactory(flags, baseFactory2) {
14593
14837
  return update(updated, original);
14594
14838
  }
14595
14839
  function createEnumDeclaration(modifiers, name, members) {
14596
- const node = createBaseNamedDeclaration(
14597
- 263 /* EnumDeclaration */,
14598
- modifiers,
14599
- name
14600
- );
14840
+ const node = createBaseDeclaration(263 /* EnumDeclaration */);
14841
+ node.modifiers = asNodeArray(modifiers);
14842
+ node.name = asName(name);
14601
14843
  node.members = createNodeArray(members);
14602
- node.transformFlags |= propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */;
14844
+ node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */;
14603
14845
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14604
14846
  node.illegalDecorators = void 0;
14847
+ node.jsDoc = void 0;
14848
+ node.jsDocCache = void 0;
14605
14849
  return node;
14606
14850
  }
14607
14851
  function updateEnumDeclaration(node, modifiers, name, members) {
@@ -14626,6 +14870,10 @@ function createNodeFactory(flags, baseFactory2) {
14626
14870
  }
14627
14871
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14628
14872
  node.illegalDecorators = void 0;
14873
+ node.jsDoc = void 0;
14874
+ node.jsDocCache = void 0;
14875
+ node.locals = void 0;
14876
+ node.nextContainer = void 0;
14629
14877
  return node;
14630
14878
  }
14631
14879
  function updateModuleDeclaration(node, modifiers, name, body) {
@@ -14641,6 +14889,8 @@ function createNodeFactory(flags, baseFactory2) {
14641
14889
  const node = createBaseNode(265 /* ModuleBlock */);
14642
14890
  node.statements = createNodeArray(statements);
14643
14891
  node.transformFlags |= propagateChildrenFlags(node.statements);
14892
+ node.jsDoc = void 0;
14893
+ node.jsDocCache = void 0;
14644
14894
  return node;
14645
14895
  }
14646
14896
  function updateModuleBlock(node, statements) {
@@ -14650,20 +14900,21 @@ function createNodeFactory(flags, baseFactory2) {
14650
14900
  const node = createBaseNode(266 /* CaseBlock */);
14651
14901
  node.clauses = createNodeArray(clauses);
14652
14902
  node.transformFlags |= propagateChildrenFlags(node.clauses);
14903
+ node.locals = void 0;
14904
+ node.nextContainer = void 0;
14653
14905
  return node;
14654
14906
  }
14655
14907
  function updateCaseBlock(node, clauses) {
14656
14908
  return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node;
14657
14909
  }
14658
14910
  function createNamespaceExportDeclaration(name) {
14659
- const node = createBaseNamedDeclaration(
14660
- 267 /* NamespaceExportDeclaration */,
14661
- void 0,
14662
- name
14663
- );
14664
- node.transformFlags = 1 /* ContainsTypeScript */;
14911
+ const node = createBaseDeclaration(267 /* NamespaceExportDeclaration */);
14912
+ node.name = asName(name);
14913
+ node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */;
14665
14914
  node.illegalDecorators = void 0;
14666
14915
  node.modifiers = void 0;
14916
+ node.jsDoc = void 0;
14917
+ node.jsDocCache = void 0;
14667
14918
  return node;
14668
14919
  }
14669
14920
  function updateNamespaceExportDeclaration(node, name) {
@@ -14677,18 +14928,19 @@ function createNodeFactory(flags, baseFactory2) {
14677
14928
  return update(updated, original);
14678
14929
  }
14679
14930
  function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) {
14680
- const node = createBaseNamedDeclaration(
14681
- 268 /* ImportEqualsDeclaration */,
14682
- modifiers,
14683
- name
14684
- );
14931
+ const node = createBaseDeclaration(268 /* ImportEqualsDeclaration */);
14932
+ node.modifiers = asNodeArray(modifiers);
14933
+ node.name = asName(name);
14685
14934
  node.isTypeOnly = isTypeOnly;
14686
14935
  node.moduleReference = moduleReference;
14687
- node.transformFlags |= propagateChildFlags(node.moduleReference);
14688
- if (!isExternalModuleReference(node.moduleReference))
14936
+ node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.moduleReference);
14937
+ if (!isExternalModuleReference(node.moduleReference)) {
14689
14938
  node.transformFlags |= 1 /* ContainsTypeScript */;
14939
+ }
14690
14940
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14691
14941
  node.illegalDecorators = void 0;
14942
+ node.jsDoc = void 0;
14943
+ node.jsDocCache = void 0;
14692
14944
  return node;
14693
14945
  }
14694
14946
  function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
@@ -14701,7 +14953,7 @@ function createNodeFactory(flags, baseFactory2) {
14701
14953
  return update(updated, original);
14702
14954
  }
14703
14955
  function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) {
14704
- const node = createBaseDeclaration(269 /* ImportDeclaration */);
14956
+ const node = createBaseNode(269 /* ImportDeclaration */);
14705
14957
  node.modifiers = asNodeArray(modifiers);
14706
14958
  node.importClause = importClause;
14707
14959
  node.moduleSpecifier = moduleSpecifier;
@@ -14709,6 +14961,8 @@ function createNodeFactory(flags, baseFactory2) {
14709
14961
  node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
14710
14962
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14711
14963
  node.illegalDecorators = void 0;
14964
+ node.jsDoc = void 0;
14965
+ node.jsDocCache = void 0;
14712
14966
  return node;
14713
14967
  }
14714
14968
  function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) {
@@ -14721,7 +14975,7 @@ function createNodeFactory(flags, baseFactory2) {
14721
14975
  return update(updated, original);
14722
14976
  }
14723
14977
  function createImportClause(isTypeOnly, name, namedBindings) {
14724
- const node = createBaseNode(270 /* ImportClause */);
14978
+ const node = createBaseDeclaration(270 /* ImportClause */);
14725
14979
  node.isTypeOnly = isTypeOnly;
14726
14980
  node.name = name;
14727
14981
  node.namedBindings = namedBindings;
@@ -14765,7 +15019,7 @@ function createNodeFactory(flags, baseFactory2) {
14765
15019
  return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
14766
15020
  }
14767
15021
  function createNamespaceImport(name) {
14768
- const node = createBaseNode(271 /* NamespaceImport */);
15022
+ const node = createBaseDeclaration(271 /* NamespaceImport */);
14769
15023
  node.name = name;
14770
15024
  node.transformFlags |= propagateChildFlags(node.name);
14771
15025
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -14775,7 +15029,7 @@ function createNodeFactory(flags, baseFactory2) {
14775
15029
  return node.name !== name ? update(createNamespaceImport(name), node) : node;
14776
15030
  }
14777
15031
  function createNamespaceExport(name) {
14778
- const node = createBaseNode(277 /* NamespaceExport */);
15032
+ const node = createBaseDeclaration(277 /* NamespaceExport */);
14779
15033
  node.name = name;
14780
15034
  node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
14781
15035
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
@@ -14795,7 +15049,7 @@ function createNodeFactory(flags, baseFactory2) {
14795
15049
  return node.elements !== elements ? update(createNamedImports(elements), node) : node;
14796
15050
  }
14797
15051
  function createImportSpecifier(isTypeOnly, propertyName, name) {
14798
- const node = createBaseNode(273 /* ImportSpecifier */);
15052
+ const node = createBaseDeclaration(273 /* ImportSpecifier */);
14799
15053
  node.isTypeOnly = isTypeOnly;
14800
15054
  node.propertyName = propertyName;
14801
15055
  node.name = name;
@@ -14814,6 +15068,8 @@ function createNodeFactory(flags, baseFactory2) {
14814
15068
  node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression);
14815
15069
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14816
15070
  node.illegalDecorators = void 0;
15071
+ node.jsDoc = void 0;
15072
+ node.jsDocCache = void 0;
14817
15073
  return node;
14818
15074
  }
14819
15075
  function updateExportAssignment(node, modifiers, expression) {
@@ -14835,6 +15091,8 @@ function createNodeFactory(flags, baseFactory2) {
14835
15091
  node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
14836
15092
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
14837
15093
  node.illegalDecorators = void 0;
15094
+ node.jsDoc = void 0;
15095
+ node.jsDocCache = void 0;
14838
15096
  return node;
14839
15097
  }
14840
15098
  function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
@@ -14863,6 +15121,8 @@ function createNodeFactory(flags, baseFactory2) {
14863
15121
  node.name = asName(name);
14864
15122
  node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name);
14865
15123
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
15124
+ node.jsDoc = void 0;
15125
+ node.jsDocCache = void 0;
14866
15126
  return node;
14867
15127
  }
14868
15128
  function updateExportSpecifier(node, isTypeOnly, propertyName, name) {
@@ -14870,6 +15130,8 @@ function createNodeFactory(flags, baseFactory2) {
14870
15130
  }
14871
15131
  function createMissingDeclaration() {
14872
15132
  const node = createBaseDeclaration(279 /* MissingDeclaration */);
15133
+ node.jsDoc = void 0;
15134
+ node.jsDocCache = void 0;
14873
15135
  return node;
14874
15136
  }
14875
15137
  function createExternalModuleReference(expression) {
@@ -14905,21 +15167,22 @@ function createNodeFactory(flags, baseFactory2) {
14905
15167
  return node.type !== type ? update(createJSDocUnaryTypeWorker(kind, type), node) : node;
14906
15168
  }
14907
15169
  function createJSDocFunctionType(parameters, type) {
14908
- const node = createBaseSignatureDeclaration(
14909
- 320 /* JSDocFunctionType */,
14910
- void 0,
14911
- void 0,
14912
- void 0,
14913
- parameters,
14914
- type
14915
- );
15170
+ const node = createBaseDeclaration(320 /* JSDocFunctionType */);
15171
+ node.parameters = asNodeArray(parameters);
15172
+ node.type = type;
15173
+ node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */);
15174
+ node.jsDoc = void 0;
15175
+ node.jsDocCache = void 0;
15176
+ node.locals = void 0;
15177
+ node.nextContainer = void 0;
15178
+ node.typeArguments = void 0;
14916
15179
  return node;
14917
15180
  }
14918
15181
  function updateJSDocFunctionType(node, parameters, type) {
14919
15182
  return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node;
14920
15183
  }
14921
15184
  function createJSDocTypeLiteral(propertyTags, isArrayType = false) {
14922
- const node = createBaseNode(325 /* JSDocTypeLiteral */);
15185
+ const node = createBaseDeclaration(325 /* JSDocTypeLiteral */);
14923
15186
  node.jsDocPropertyTags = asNodeArray(propertyTags);
14924
15187
  node.isArrayType = isArrayType;
14925
15188
  return node;
@@ -14936,10 +15199,14 @@ function createNodeFactory(flags, baseFactory2) {
14936
15199
  return node.type !== type ? update(createJSDocTypeExpression(type), node) : node;
14937
15200
  }
14938
15201
  function createJSDocSignature(typeParameters, parameters, type) {
14939
- const node = createBaseNode(326 /* JSDocSignature */);
15202
+ const node = createBaseDeclaration(326 /* JSDocSignature */);
14940
15203
  node.typeParameters = asNodeArray(typeParameters);
14941
15204
  node.parameters = createNodeArray(parameters);
14942
15205
  node.type = type;
15206
+ node.jsDoc = void 0;
15207
+ node.jsDocCache = void 0;
15208
+ node.locals = void 0;
15209
+ node.nextContainer = void 0;
14943
15210
  return node;
14944
15211
  }
14945
15212
  function updateJSDocSignature(node, typeParameters, parameters, type) {
@@ -14949,14 +15216,20 @@ function createNodeFactory(flags, baseFactory2) {
14949
15216
  const defaultTagName = getDefaultTagNameForKind(node.kind);
14950
15217
  return node.tagName.escapedText === escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier(defaultTagName);
14951
15218
  }
14952
- function createBaseJSDocTag(kind, tagName, comment) {
14953
- const node = createBaseNode(kind);
15219
+ function createBaseJSDocTag(kind, tagName, comment) {
15220
+ const node = createBaseNode(kind);
15221
+ node.tagName = tagName;
15222
+ node.comment = comment;
15223
+ return node;
15224
+ }
15225
+ function createBaseJSDocTagDeclaration(kind, tagName, comment) {
15226
+ const node = createBaseDeclaration(kind);
14954
15227
  node.tagName = tagName;
14955
15228
  node.comment = comment;
14956
15229
  return node;
14957
15230
  }
14958
15231
  function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) {
14959
- const node = createBaseJSDocTag(347 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment);
15232
+ const node = createBaseJSDocTag(348 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment);
14960
15233
  node.constraint = constraint;
14961
15234
  node.typeParameters = createNodeArray(typeParameters);
14962
15235
  return node;
@@ -14965,17 +15238,19 @@ function createNodeFactory(flags, baseFactory2) {
14965
15238
  return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node;
14966
15239
  }
14967
15240
  function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) {
14968
- const node = createBaseJSDocTag(348 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment);
15241
+ const node = createBaseJSDocTagDeclaration(349 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment);
14969
15242
  node.typeExpression = typeExpression;
14970
15243
  node.fullName = fullName;
14971
15244
  node.name = getJSDocTypeAliasName(fullName);
15245
+ node.locals = void 0;
15246
+ node.nextContainer = void 0;
14972
15247
  return node;
14973
15248
  }
14974
15249
  function updateJSDocTypedefTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) {
14975
15250
  return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node;
14976
15251
  }
14977
15252
  function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
14978
- const node = createBaseJSDocTag(343 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment);
15253
+ const node = createBaseJSDocTagDeclaration(344 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment);
14979
15254
  node.typeExpression = typeExpression;
14980
15255
  node.name = name;
14981
15256
  node.isNameFirst = !!isNameFirst;
@@ -14986,7 +15261,7 @@ function createNodeFactory(flags, baseFactory2) {
14986
15261
  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;
14987
15262
  }
14988
15263
  function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
14989
- const node = createBaseJSDocTag(350 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment);
15264
+ const node = createBaseJSDocTagDeclaration(351 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment);
14990
15265
  node.typeExpression = typeExpression;
14991
15266
  node.name = name;
14992
15267
  node.isNameFirst = !!isNameFirst;
@@ -14997,15 +15272,25 @@ function createNodeFactory(flags, baseFactory2) {
14997
15272
  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;
14998
15273
  }
14999
15274
  function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) {
15000
- const node = createBaseJSDocTag(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment);
15275
+ const node = createBaseJSDocTagDeclaration(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment);
15001
15276
  node.typeExpression = typeExpression;
15002
15277
  node.fullName = fullName;
15003
15278
  node.name = getJSDocTypeAliasName(fullName);
15279
+ node.locals = void 0;
15280
+ node.nextContainer = void 0;
15004
15281
  return node;
15005
15282
  }
15006
15283
  function updateJSDocCallbackTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) {
15007
15284
  return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node;
15008
15285
  }
15286
+ function createJSDocOverloadTag(tagName, typeExpression, comment) {
15287
+ const node = createBaseJSDocTag(342 /* JSDocOverloadTag */, tagName != null ? tagName : createIdentifier("overload"), comment);
15288
+ node.typeExpression = typeExpression;
15289
+ return node;
15290
+ }
15291
+ function updateJSDocOverloadTag(node, tagName = getDefaultTagName(node), typeExpression, comment) {
15292
+ return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocOverloadTag(tagName, typeExpression, comment), node) : node;
15293
+ }
15009
15294
  function createJSDocAugmentsTag(tagName, className, comment) {
15010
15295
  const node = createBaseJSDocTag(331 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier("augments"), comment);
15011
15296
  node.class = className;
@@ -15020,7 +15305,7 @@ function createNodeFactory(flags, baseFactory2) {
15020
15305
  return node;
15021
15306
  }
15022
15307
  function createJSDocSeeTag(tagName, name, comment) {
15023
- const node = createBaseJSDocTag(349 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment);
15308
+ const node = createBaseJSDocTag(350 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment);
15024
15309
  node.name = name;
15025
15310
  return node;
15026
15311
  }
@@ -15097,6 +15382,16 @@ function createNodeFactory(flags, baseFactory2) {
15097
15382
  function updateJSDocUnknownTag(node, tagName, comment) {
15098
15383
  return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node;
15099
15384
  }
15385
+ function createJSDocEnumTag(tagName, typeExpression, comment) {
15386
+ const node = createBaseJSDocTagDeclaration(343 /* JSDocEnumTag */, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(343 /* JSDocEnumTag */)), comment);
15387
+ node.typeExpression = typeExpression;
15388
+ node.locals = void 0;
15389
+ node.nextContainer = void 0;
15390
+ return node;
15391
+ }
15392
+ function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) {
15393
+ return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node;
15394
+ }
15100
15395
  function createJSDocText(text) {
15101
15396
  const node = createBaseNode(324 /* JSDocText */);
15102
15397
  node.text = text;
@@ -15194,7 +15489,7 @@ function createNodeFactory(flags, baseFactory2) {
15194
15489
  return node;
15195
15490
  }
15196
15491
  function createJsxAttribute(name, initializer) {
15197
- const node = createBaseNode(288 /* JsxAttribute */);
15492
+ const node = createBaseDeclaration(288 /* JsxAttribute */);
15198
15493
  node.name = name;
15199
15494
  node.initializer = initializer;
15200
15495
  node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */;
@@ -15204,7 +15499,7 @@ function createNodeFactory(flags, baseFactory2) {
15204
15499
  return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node;
15205
15500
  }
15206
15501
  function createJsxAttributes(properties) {
15207
- const node = createBaseNode(289 /* JsxAttributes */);
15502
+ const node = createBaseDeclaration(289 /* JsxAttributes */);
15208
15503
  node.properties = createNodeArray(properties);
15209
15504
  node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */;
15210
15505
  return node;
@@ -15236,6 +15531,8 @@ function createNodeFactory(flags, baseFactory2) {
15236
15531
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
15237
15532
  node.statements = createNodeArray(statements);
15238
15533
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
15534
+ node.jsDoc = void 0;
15535
+ node.jsDocCache = void 0;
15239
15536
  return node;
15240
15537
  }
15241
15538
  function updateCaseClause(node, expression, statements) {
@@ -15272,36 +15569,27 @@ function createNodeFactory(flags, baseFactory2) {
15272
15569
  }
15273
15570
  function createCatchClause(variableDeclaration, block) {
15274
15571
  const node = createBaseNode(295 /* CatchClause */);
15275
- if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
15276
- variableDeclaration = createVariableDeclaration(
15277
- variableDeclaration,
15278
- void 0,
15279
- void 0,
15280
- void 0
15281
- );
15282
- }
15283
- node.variableDeclaration = variableDeclaration;
15572
+ node.variableDeclaration = asVariableDeclaration(variableDeclaration);
15284
15573
  node.block = block;
15285
- node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block);
15286
- if (!variableDeclaration)
15287
- node.transformFlags |= 64 /* ContainsES2019 */;
15574
+ node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block) | (!variableDeclaration ? 64 /* ContainsES2019 */ : 0 /* None */);
15575
+ node.locals = void 0;
15576
+ node.nextContainer = void 0;
15288
15577
  return node;
15289
15578
  }
15290
15579
  function updateCatchClause(node, variableDeclaration, block) {
15291
15580
  return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node;
15292
15581
  }
15293
15582
  function createPropertyAssignment(name, initializer) {
15294
- const node = createBaseNamedDeclaration(
15295
- 299 /* PropertyAssignment */,
15296
- void 0,
15297
- name
15298
- );
15583
+ const node = createBaseDeclaration(299 /* PropertyAssignment */);
15584
+ node.name = asName(name);
15299
15585
  node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
15300
- node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer);
15586
+ node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer);
15301
15587
  node.illegalDecorators = void 0;
15302
15588
  node.modifiers = void 0;
15303
15589
  node.questionToken = void 0;
15304
15590
  node.exclamationToken = void 0;
15591
+ node.jsDoc = void 0;
15592
+ node.jsDocCache = void 0;
15305
15593
  return node;
15306
15594
  }
15307
15595
  function updatePropertyAssignment(node, name, initializer) {
@@ -15317,18 +15605,17 @@ function createNodeFactory(flags, baseFactory2) {
15317
15605
  return update(updated, original);
15318
15606
  }
15319
15607
  function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {
15320
- const node = createBaseNamedDeclaration(
15321
- 300 /* ShorthandPropertyAssignment */,
15322
- void 0,
15323
- name
15324
- );
15608
+ const node = createBaseDeclaration(300 /* ShorthandPropertyAssignment */);
15609
+ node.name = asName(name);
15325
15610
  node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer);
15326
- node.transformFlags |= propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */;
15611
+ node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */;
15327
15612
  node.equalsToken = void 0;
15328
15613
  node.illegalDecorators = void 0;
15329
15614
  node.modifiers = void 0;
15330
15615
  node.questionToken = void 0;
15331
15616
  node.exclamationToken = void 0;
15617
+ node.jsDoc = void 0;
15618
+ node.jsDocCache = void 0;
15332
15619
  return node;
15333
15620
  }
15334
15621
  function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) {
@@ -15345,19 +15632,23 @@ function createNodeFactory(flags, baseFactory2) {
15345
15632
  return update(updated, original);
15346
15633
  }
15347
15634
  function createSpreadAssignment(expression) {
15348
- const node = createBaseNode(301 /* SpreadAssignment */);
15635
+ const node = createBaseDeclaration(301 /* SpreadAssignment */);
15349
15636
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
15350
15637
  node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
15638
+ node.jsDoc = void 0;
15639
+ node.jsDocCache = void 0;
15351
15640
  return node;
15352
15641
  }
15353
15642
  function updateSpreadAssignment(node, expression) {
15354
15643
  return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node;
15355
15644
  }
15356
15645
  function createEnumMember(name, initializer) {
15357
- const node = createBaseNode(302 /* EnumMember */);
15646
+ const node = createBaseDeclaration(302 /* EnumMember */);
15358
15647
  node.name = asName(name);
15359
15648
  node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
15360
15649
  node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
15650
+ node.jsDoc = void 0;
15651
+ node.jsDocCache = void 0;
15361
15652
  return node;
15362
15653
  }
15363
15654
  function updateEnumMember(node, name, initializer) {
@@ -15368,33 +15659,111 @@ function createNodeFactory(flags, baseFactory2) {
15368
15659
  node.statements = createNodeArray(statements);
15369
15660
  node.endOfFileToken = endOfFileToken;
15370
15661
  node.flags |= flags2;
15371
- node.fileName = "";
15372
15662
  node.text = "";
15663
+ node.fileName = "";
15664
+ node.path = "";
15665
+ node.resolvedPath = "";
15666
+ node.originalFileName = "";
15373
15667
  node.languageVersion = 0;
15374
15668
  node.languageVariant = 0;
15375
15669
  node.scriptKind = 0;
15376
15670
  node.isDeclarationFile = false;
15377
15671
  node.hasNoDefaultLib = false;
15378
15672
  node.transformFlags |= propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken);
15673
+ node.locals = void 0;
15674
+ node.nextContainer = void 0;
15675
+ node.endFlowNode = void 0;
15676
+ node.nodeCount = 0;
15677
+ node.identifierCount = 0;
15678
+ node.symbolCount = 0;
15679
+ node.parseDiagnostics = void 0;
15680
+ node.bindDiagnostics = void 0;
15681
+ node.bindSuggestionDiagnostics = void 0;
15682
+ node.lineMap = void 0;
15683
+ node.externalModuleIndicator = void 0;
15684
+ node.setExternalModuleIndicator = void 0;
15685
+ node.pragmas = void 0;
15686
+ node.checkJsDirective = void 0;
15687
+ node.referencedFiles = void 0;
15688
+ node.typeReferenceDirectives = void 0;
15689
+ node.libReferenceDirectives = void 0;
15690
+ node.amdDependencies = void 0;
15691
+ node.commentDirectives = void 0;
15692
+ node.identifiers = void 0;
15693
+ node.packageJsonLocations = void 0;
15694
+ node.packageJsonScope = void 0;
15695
+ node.imports = void 0;
15696
+ node.moduleAugmentations = void 0;
15697
+ node.ambientModuleNames = void 0;
15698
+ node.resolvedModules = void 0;
15699
+ node.classifiableNames = void 0;
15700
+ node.impliedNodeFormat = void 0;
15379
15701
  return node;
15380
15702
  }
15381
- function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
15382
- const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(308 /* SourceFile */);
15703
+ function createRedirectedSourceFile(redirectInfo) {
15704
+ const node = Object.create(redirectInfo.redirectTarget);
15705
+ Object.defineProperties(node, {
15706
+ id: {
15707
+ get() {
15708
+ return this.redirectInfo.redirectTarget.id;
15709
+ },
15710
+ set(value) {
15711
+ this.redirectInfo.redirectTarget.id = value;
15712
+ }
15713
+ },
15714
+ symbol: {
15715
+ get() {
15716
+ return this.redirectInfo.redirectTarget.symbol;
15717
+ },
15718
+ set(value) {
15719
+ this.redirectInfo.redirectTarget.symbol = value;
15720
+ }
15721
+ }
15722
+ });
15723
+ node.redirectInfo = redirectInfo;
15724
+ return node;
15725
+ }
15726
+ function cloneRedirectedSourceFile(source) {
15727
+ const node = createRedirectedSourceFile(source.redirectInfo);
15728
+ node.flags |= source.flags & ~8 /* Synthesized */;
15729
+ node.fileName = source.fileName;
15730
+ node.path = source.path;
15731
+ node.resolvedPath = source.resolvedPath;
15732
+ node.originalFileName = source.originalFileName;
15733
+ node.packageJsonLocations = source.packageJsonLocations;
15734
+ node.packageJsonScope = source.packageJsonScope;
15735
+ node.emitNode = void 0;
15736
+ return node;
15737
+ }
15738
+ function cloneSourceFileWorker(source) {
15739
+ const node = baseFactory2.createBaseSourceFileNode(308 /* SourceFile */);
15740
+ node.flags |= source.flags & ~8 /* Synthesized */;
15383
15741
  for (const p in source) {
15384
- if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p))
15742
+ if (hasProperty(node, p) || !hasProperty(source, p)) {
15743
+ continue;
15744
+ }
15745
+ if (p === "emitNode") {
15746
+ node.emitNode = void 0;
15385
15747
  continue;
15748
+ }
15386
15749
  node[p] = source[p];
15387
15750
  }
15388
- node.flags |= source.flags;
15751
+ return node;
15752
+ }
15753
+ function cloneSourceFile(source) {
15754
+ const node = source.redirectInfo ? cloneRedirectedSourceFile(source) : cloneSourceFileWorker(source);
15755
+ setOriginalNode(node, source);
15756
+ return node;
15757
+ }
15758
+ function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
15759
+ const node = cloneSourceFile(source);
15389
15760
  node.statements = createNodeArray(statements);
15390
- node.endOfFileToken = source.endOfFileToken;
15391
15761
  node.isDeclarationFile = isDeclarationFile;
15392
15762
  node.referencedFiles = referencedFiles;
15393
15763
  node.typeReferenceDirectives = typeReferences;
15394
15764
  node.hasNoDefaultLib = hasNoDefaultLib;
15395
15765
  node.libReferenceDirectives = libReferences;
15396
15766
  node.transformFlags = propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken);
15397
- node.impliedNodeFormat = source.impliedNodeFormat;
15398
15767
  return node;
15399
15768
  }
15400
15769
  function updateSourceFile(node, statements, isDeclarationFile = node.isDeclarationFile, referencedFiles = node.referencedFiles, typeReferenceDirectives = node.typeReferenceDirectives, hasNoDefaultLib = node.hasNoDefaultLib, libReferenceDirectives = node.libReferenceDirectives) {
@@ -15404,6 +15773,10 @@ function createNodeFactory(flags, baseFactory2) {
15404
15773
  const node = createBaseNode(309 /* Bundle */);
15405
15774
  node.prepends = prepends;
15406
15775
  node.sourceFiles = sourceFiles;
15776
+ node.syntheticFileReferences = void 0;
15777
+ node.syntheticTypeReferences = void 0;
15778
+ node.syntheticLibReferences = void 0;
15779
+ node.hasNoDefaultLib = void 0;
15407
15780
  return node;
15408
15781
  }
15409
15782
  function updateBundle(node, sourceFiles, prepends = emptyArray) {
@@ -15457,18 +15830,18 @@ function createNodeFactory(flags, baseFactory2) {
15457
15830
  return node;
15458
15831
  }
15459
15832
  function createSyntaxList(children) {
15460
- const node = createBaseNode(351 /* SyntaxList */);
15833
+ const node = createBaseNode(353 /* SyntaxList */);
15461
15834
  node._children = children;
15462
15835
  return node;
15463
15836
  }
15464
15837
  function createNotEmittedStatement(original) {
15465
- const node = createBaseNode(352 /* NotEmittedStatement */);
15838
+ const node = createBaseNode(354 /* NotEmittedStatement */);
15466
15839
  node.original = original;
15467
15840
  setTextRange(node, original);
15468
15841
  return node;
15469
15842
  }
15470
15843
  function createPartiallyEmittedExpression(expression, original) {
15471
- const node = createBaseNode(353 /* PartiallyEmittedExpression */);
15844
+ const node = createBaseNode(355 /* PartiallyEmittedExpression */);
15472
15845
  node.expression = expression;
15473
15846
  node.original = original;
15474
15847
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -15490,7 +15863,7 @@ function createNodeFactory(flags, baseFactory2) {
15490
15863
  return node;
15491
15864
  }
15492
15865
  function createCommaListExpression(elements) {
15493
- const node = createBaseNode(354 /* CommaListExpression */);
15866
+ const node = createBaseNode(356 /* CommaListExpression */);
15494
15867
  node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
15495
15868
  node.transformFlags |= propagateChildrenFlags(node.elements);
15496
15869
  return node;
@@ -15499,19 +15872,19 @@ function createNodeFactory(flags, baseFactory2) {
15499
15872
  return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
15500
15873
  }
15501
15874
  function createEndOfDeclarationMarker(original) {
15502
- const node = createBaseNode(356 /* EndOfDeclarationMarker */);
15875
+ const node = createBaseNode(358 /* EndOfDeclarationMarker */);
15503
15876
  node.emitNode = {};
15504
15877
  node.original = original;
15505
15878
  return node;
15506
15879
  }
15507
15880
  function createMergeDeclarationMarker(original) {
15508
- const node = createBaseNode(355 /* MergeDeclarationMarker */);
15881
+ const node = createBaseNode(357 /* MergeDeclarationMarker */);
15509
15882
  node.emitNode = {};
15510
15883
  node.original = original;
15511
15884
  return node;
15512
15885
  }
15513
15886
  function createSyntheticReferenceExpression(expression, thisArg) {
15514
- const node = createBaseNode(357 /* SyntheticReferenceExpression */);
15887
+ const node = createBaseNode(359 /* SyntheticReferenceExpression */);
15515
15888
  node.expression = expression;
15516
15889
  node.thisArg = thisArg;
15517
15890
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -15520,11 +15893,68 @@ function createNodeFactory(flags, baseFactory2) {
15520
15893
  function updateSyntheticReferenceExpression(node, expression, thisArg) {
15521
15894
  return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node;
15522
15895
  }
15896
+ function cloneGeneratedIdentifier(node) {
15897
+ const clone2 = createBaseIdentifier(node.escapedText, void 0);
15898
+ clone2.flags |= node.flags & ~8 /* Synthesized */;
15899
+ clone2.autoGenerateFlags = node.autoGenerateFlags;
15900
+ clone2.autoGenerateId = node.autoGenerateId;
15901
+ clone2.autoGeneratePrefix = node.autoGeneratePrefix;
15902
+ clone2.autoGenerateSuffix = node.autoGenerateSuffix;
15903
+ clone2.transformFlags = node.transformFlags;
15904
+ setOriginalNode(clone2, node);
15905
+ return clone2;
15906
+ }
15907
+ function cloneIdentifier(node) {
15908
+ const clone2 = createBaseIdentifier(node.escapedText, node.originalKeywordKind);
15909
+ clone2.flags |= node.flags & ~8 /* Synthesized */;
15910
+ clone2.typeArguments = node.typeArguments;
15911
+ clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape;
15912
+ clone2.jsDoc = node.jsDoc;
15913
+ clone2.jsDocCache = node.jsDocCache;
15914
+ clone2.flowNode = node.flowNode;
15915
+ clone2.symbol = node.symbol;
15916
+ clone2.transformFlags = node.transformFlags;
15917
+ setOriginalNode(clone2, node);
15918
+ return clone2;
15919
+ }
15920
+ function cloneGeneratedPrivateIdentifier(node) {
15921
+ const clone2 = createBasePrivateIdentifier(node.escapedText);
15922
+ clone2.flags |= node.flags & ~8 /* Synthesized */;
15923
+ clone2.autoGenerateFlags = node.autoGenerateFlags;
15924
+ clone2.autoGenerateId = node.autoGenerateId;
15925
+ clone2.autoGeneratePrefix = node.autoGeneratePrefix;
15926
+ clone2.autoGenerateSuffix = node.autoGenerateSuffix;
15927
+ clone2.transformFlags = node.transformFlags;
15928
+ setOriginalNode(clone2, node);
15929
+ return clone2;
15930
+ }
15931
+ function clonePrivateIdentifier(node) {
15932
+ const clone2 = createBasePrivateIdentifier(node.escapedText);
15933
+ clone2.flags |= node.flags & ~8 /* Synthesized */;
15934
+ clone2.transformFlags = node.transformFlags;
15935
+ setOriginalNode(clone2, node);
15936
+ return clone2;
15937
+ }
15523
15938
  function cloneNode(node) {
15524
15939
  if (node === void 0) {
15525
15940
  return node;
15526
15941
  }
15527
- const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(308 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
15942
+ if (isSourceFile(node)) {
15943
+ return cloneSourceFile(node);
15944
+ }
15945
+ if (isGeneratedIdentifier(node)) {
15946
+ return cloneGeneratedIdentifier(node);
15947
+ }
15948
+ if (isIdentifier(node)) {
15949
+ return cloneIdentifier(node);
15950
+ }
15951
+ if (isGeneratedPrivateIdentifier(node)) {
15952
+ return cloneGeneratedPrivateIdentifier(node);
15953
+ }
15954
+ if (isPrivateIdentifier(node)) {
15955
+ return clonePrivateIdentifier(node);
15956
+ }
15957
+ const clone2 = !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
15528
15958
  clone2.flags |= node.flags & ~8 /* Synthesized */;
15529
15959
  clone2.transformFlags = node.transformFlags;
15530
15960
  setOriginalNode(clone2, node);
@@ -15659,7 +16089,7 @@ function createNodeFactory(flags, baseFactory2) {
15659
16089
  return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
15660
16090
  case 232 /* NonNullExpression */:
15661
16091
  return updateNonNullExpression(outerExpression, expression);
15662
- case 353 /* PartiallyEmittedExpression */:
16092
+ case 355 /* PartiallyEmittedExpression */:
15663
16093
  return updatePartiallyEmittedExpression(outerExpression, expression);
15664
16094
  }
15665
16095
  }
@@ -15963,12 +16393,26 @@ function createNodeFactory(flags, baseFactory2) {
15963
16393
  function asExpression(value) {
15964
16394
  return typeof value === "string" ? createStringLiteral(value) : typeof value === "number" ? createNumericLiteral(value) : typeof value === "boolean" ? value ? createTrue() : createFalse() : value;
15965
16395
  }
16396
+ function asInitializer(node) {
16397
+ return node && parenthesizerRules().parenthesizeExpressionForDisallowedComma(node);
16398
+ }
15966
16399
  function asToken(value) {
15967
16400
  return typeof value === "number" ? createToken(value) : value;
15968
16401
  }
15969
16402
  function asEmbeddedStatement(statement) {
15970
16403
  return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement;
15971
16404
  }
16405
+ function asVariableDeclaration(variableDeclaration) {
16406
+ if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
16407
+ return createVariableDeclaration(
16408
+ variableDeclaration,
16409
+ void 0,
16410
+ void 0,
16411
+ void 0
16412
+ );
16413
+ }
16414
+ return variableDeclaration;
16415
+ }
15972
16416
  }
15973
16417
  function updateWithoutOriginal(updated, original) {
15974
16418
  if (updated !== original) {
@@ -15985,13 +16429,13 @@ function updateWithOriginal(updated, original) {
15985
16429
  }
15986
16430
  function getDefaultTagNameForKind(kind) {
15987
16431
  switch (kind) {
15988
- case 346 /* JSDocTypeTag */:
16432
+ case 347 /* JSDocTypeTag */:
15989
16433
  return "type";
15990
- case 344 /* JSDocReturnTag */:
16434
+ case 345 /* JSDocReturnTag */:
15991
16435
  return "returns";
15992
- case 345 /* JSDocThisTag */:
16436
+ case 346 /* JSDocThisTag */:
15993
16437
  return "this";
15994
- case 342 /* JSDocEnumTag */:
16438
+ case 343 /* JSDocEnumTag */:
15995
16439
  return "enum";
15996
16440
  case 333 /* JSDocAuthorTag */:
15997
16441
  return "author";
@@ -16007,16 +16451,18 @@ function getDefaultTagNameForKind(kind) {
16007
16451
  return "readonly";
16008
16452
  case 340 /* JSDocOverrideTag */:
16009
16453
  return "override";
16010
- case 347 /* JSDocTemplateTag */:
16454
+ case 348 /* JSDocTemplateTag */:
16011
16455
  return "template";
16012
- case 348 /* JSDocTypedefTag */:
16456
+ case 349 /* JSDocTypedefTag */:
16013
16457
  return "typedef";
16014
- case 343 /* JSDocParameterTag */:
16458
+ case 344 /* JSDocParameterTag */:
16015
16459
  return "param";
16016
- case 350 /* JSDocPropertyTag */:
16460
+ case 351 /* JSDocPropertyTag */:
16017
16461
  return "prop";
16018
16462
  case 341 /* JSDocCallbackTag */:
16019
16463
  return "callback";
16464
+ case 342 /* JSDocOverloadTag */:
16465
+ return "overload";
16020
16466
  case 331 /* JSDocAugmentsTag */:
16021
16467
  return "augments";
16022
16468
  case 332 /* JSDocImplementsTag */:
@@ -16069,6 +16515,9 @@ function getCookedText(kind, rawText) {
16069
16515
  rawTextScanner.setText(void 0);
16070
16516
  return tokenValue;
16071
16517
  }
16518
+ function propagateNameFlags(node) {
16519
+ return node && isIdentifier(node) ? propagateIdentifierNameFlags(node) : propagateChildFlags(node);
16520
+ }
16072
16521
  function propagateIdentifierNameFlags(node) {
16073
16522
  return propagateChildFlags(node) & ~67108864 /* ContainsPossibleTopLevelAwait */;
16074
16523
  }
@@ -16150,7 +16599,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
16150
16599
  case 213 /* TypeAssertionExpression */:
16151
16600
  case 235 /* SatisfiesExpression */:
16152
16601
  case 231 /* AsExpression */:
16153
- case 353 /* PartiallyEmittedExpression */:
16602
+ case 355 /* PartiallyEmittedExpression */:
16154
16603
  case 214 /* ParenthesizedExpression */:
16155
16604
  case 106 /* SuperKeyword */:
16156
16605
  return -2147483648 /* OuterExpressionExcludes */;
@@ -16563,7 +17012,7 @@ function isMetaProperty(node) {
16563
17012
  return node.kind === 233 /* MetaProperty */;
16564
17013
  }
16565
17014
  function isCommaListExpression(node) {
16566
- return node.kind === 354 /* CommaListExpression */;
17015
+ return node.kind === 356 /* CommaListExpression */;
16567
17016
  }
16568
17017
  function isTemplateSpan(node) {
16569
17018
  return node.kind === 236 /* TemplateSpan */;
@@ -16644,7 +17093,7 @@ function isExportSpecifier(node) {
16644
17093
  return node.kind === 278 /* ExportSpecifier */;
16645
17094
  }
16646
17095
  function isNotEmittedStatement(node) {
16647
- return node.kind === 352 /* NotEmittedStatement */;
17096
+ return node.kind === 354 /* NotEmittedStatement */;
16648
17097
  }
16649
17098
  function isExternalModuleReference(node) {
16650
17099
  return node.kind === 280 /* ExternalModuleReference */;
@@ -16716,19 +17165,19 @@ function isJSDocDeprecatedTag(node) {
16716
17165
  return node.kind === 334 /* JSDocDeprecatedTag */;
16717
17166
  }
16718
17167
  function isJSDocEnumTag(node) {
16719
- return node.kind === 342 /* JSDocEnumTag */;
17168
+ return node.kind === 343 /* JSDocEnumTag */;
16720
17169
  }
16721
17170
  function isJSDocParameterTag(node) {
16722
- return node.kind === 343 /* JSDocParameterTag */;
17171
+ return node.kind === 344 /* JSDocParameterTag */;
16723
17172
  }
16724
17173
  function isJSDocReturnTag(node) {
16725
- return node.kind === 344 /* JSDocReturnTag */;
17174
+ return node.kind === 345 /* JSDocReturnTag */;
16726
17175
  }
16727
17176
  function isJSDocTypeTag(node) {
16728
- return node.kind === 346 /* JSDocTypeTag */;
17177
+ return node.kind === 347 /* JSDocTypeTag */;
16729
17178
  }
16730
17179
  function isJSDocTemplateTag(node) {
16731
- return node.kind === 347 /* JSDocTemplateTag */;
17180
+ return node.kind === 348 /* JSDocTemplateTag */;
16732
17181
  }
16733
17182
 
16734
17183
  // src/compiler/factory/utilities.ts
@@ -16751,7 +17200,7 @@ function findUseStrictPrologue(statements) {
16751
17200
  return void 0;
16752
17201
  }
16753
17202
  function isCommaSequence(node) {
16754
- return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 354 /* CommaListExpression */;
17203
+ return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 356 /* CommaListExpression */;
16755
17204
  }
16756
17205
  function isJSDocTypeAssertion(node) {
16757
17206
  return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
@@ -16769,7 +17218,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
16769
17218
  return (kinds & 2 /* TypeAssertions */) !== 0;
16770
17219
  case 232 /* NonNullExpression */:
16771
17220
  return (kinds & 4 /* NonNullAssertions */) !== 0;
16772
- case 353 /* PartiallyEmittedExpression */:
17221
+ case 355 /* PartiallyEmittedExpression */:
16773
17222
  return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
16774
17223
  }
16775
17224
  return false;
@@ -17417,7 +17866,7 @@ var forEachChildTable = {
17417
17866
  [279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
17418
17867
  return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
17419
17868
  },
17420
- [354 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
17869
+ [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
17421
17870
  return visitNodes(cbNode, cbNodes, node.elements);
17422
17871
  },
17423
17872
  [281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
@@ -17456,7 +17905,7 @@ var forEachChildTable = {
17456
17905
  [323 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
17457
17906
  return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags);
17458
17907
  },
17459
- [349 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
17908
+ [350 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
17460
17909
  return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
17461
17910
  },
17462
17911
  [313 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
@@ -17465,8 +17914,8 @@ var forEachChildTable = {
17465
17914
  [314 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
17466
17915
  return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
17467
17916
  },
17468
- [343 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
17469
- [350 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
17917
+ [344 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
17918
+ [351 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
17470
17919
  [333 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
17471
17920
  return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
17472
17921
  },
@@ -17476,19 +17925,20 @@ var forEachChildTable = {
17476
17925
  [331 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
17477
17926
  return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
17478
17927
  },
17479
- [347 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
17928
+ [348 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
17480
17929
  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));
17481
17930
  },
17482
- [348 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
17931
+ [349 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
17483
17932
  return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 312 /* 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)));
17484
17933
  },
17485
17934
  [341 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
17486
17935
  return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
17487
17936
  },
17488
- [344 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
17489
- [346 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
17490
- [345 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
17491
- [342 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
17937
+ [345 /* JSDocReturnTag */]: forEachChildInJSDocTypeLikeTag,
17938
+ [347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag,
17939
+ [346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag,
17940
+ [343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag,
17941
+ [352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag,
17492
17942
  [326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
17493
17943
  return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
17494
17944
  },
@@ -17506,7 +17956,7 @@ var forEachChildTable = {
17506
17956
  [339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
17507
17957
  [334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
17508
17958
  [340 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
17509
- [353 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
17959
+ [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
17510
17960
  };
17511
17961
  function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
17512
17962
  return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -17547,7 +17997,7 @@ function forEachChildInOptionalRestOrJSDocParameterModifier(node, cbNode, _cbNod
17547
17997
  function forEachChildInJSDocParameterOrPropertyTag(node, cbNode, cbNodes) {
17548
17998
  return visitNode2(cbNode, node.tagName) || (node.isNameFirst ? visitNode2(cbNode, node.name) || visitNode2(cbNode, node.typeExpression) : visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.name)) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
17549
17999
  }
17550
- function forEachChildInJSDocReturnTag(node, cbNode, cbNodes) {
18000
+ function forEachChildInJSDocTypeLikeTag(node, cbNode, cbNodes) {
17551
18001
  return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
17552
18002
  }
17553
18003
  function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) {
@@ -18726,7 +19176,7 @@ var Parser;
18726
19176
  if (!canReuseNode(node, parsingContext2)) {
18727
19177
  return void 0;
18728
19178
  }
18729
- if (node.jsDocCache) {
19179
+ if (canHaveJSDoc(node) && node.jsDocCache) {
18730
19180
  node.jsDocCache = void 0;
18731
19181
  }
18732
19182
  return node;
@@ -22798,9 +23248,16 @@ var Parser;
22798
23248
  case "callback":
22799
23249
  tag = parseCallbackTag(start2, tagName, margin, indentText);
22800
23250
  break;
23251
+ case "overload":
23252
+ tag = parseOverloadTag(start2, tagName, margin, indentText);
23253
+ break;
22801
23254
  case "see":
22802
23255
  tag = parseSeeTag(start2, tagName, margin, indentText);
22803
23256
  break;
23257
+ case "exception":
23258
+ case "throws":
23259
+ tag = parseThrowsTag(start2, tagName, margin, indentText);
23260
+ break;
22804
23261
  default:
22805
23262
  tag = parseUnknownTag(start2, tagName, margin, indentText);
22806
23263
  break;
@@ -23022,7 +23479,7 @@ var Parser;
23022
23479
  let child;
23023
23480
  let children;
23024
23481
  while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
23025
- if (child.kind === 343 /* JSDocParameterTag */ || child.kind === 350 /* JSDocPropertyTag */) {
23482
+ if (child.kind === 344 /* JSDocParameterTag */ || child.kind === 351 /* JSDocPropertyTag */) {
23026
23483
  children = append(children, child);
23027
23484
  }
23028
23485
  }
@@ -23053,6 +23510,11 @@ var Parser;
23053
23510
  const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0;
23054
23511
  return finishNode(factory2.createJSDocSeeTag(tagName, nameExpression, comments2), start2);
23055
23512
  }
23513
+ function parseThrowsTag(start2, tagName, indent2, indentText) {
23514
+ const typeExpression = tryParseTypeExpression();
23515
+ const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
23516
+ return finishNode(factory2.createJSDocThrowsTag(tagName, typeExpression, comment), start2);
23517
+ }
23056
23518
  function parseAuthorTag(start2, tagName, indent2, indentText) {
23057
23519
  const commentStart = getNodePos();
23058
23520
  const textOnly = parseAuthorNameAndEmail();
@@ -23140,7 +23602,7 @@ var Parser;
23140
23602
  let hasChildren = false;
23141
23603
  while (child = tryParse(() => parseChildPropertyTag(indent2))) {
23142
23604
  hasChildren = true;
23143
- if (child.kind === 346 /* JSDocTypeTag */) {
23605
+ if (child.kind === 347 /* JSDocTypeTag */) {
23144
23606
  if (childTypeTag) {
23145
23607
  const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
23146
23608
  if (lastError) {
@@ -23198,26 +23660,39 @@ var Parser;
23198
23660
  }
23199
23661
  return createNodeArray(parameters || [], pos);
23200
23662
  }
23201
- function parseCallbackTag(start2, tagName, indent2, indentText) {
23202
- const fullName = parseJSDocTypeNameWithNamespace();
23203
- skipWhitespace();
23204
- let comment = parseTagComments(indent2);
23663
+ function parseJSDocSignature(start2, indent2) {
23205
23664
  const parameters = parseCallbackTagParameters(indent2);
23206
23665
  const returnTag = tryParse(() => {
23207
23666
  if (parseOptionalJsdoc(59 /* AtToken */)) {
23208
23667
  const tag = parseTag(indent2);
23209
- if (tag && tag.kind === 344 /* JSDocReturnTag */) {
23668
+ if (tag && tag.kind === 345 /* JSDocReturnTag */) {
23210
23669
  return tag;
23211
23670
  }
23212
23671
  }
23213
23672
  });
23214
- const typeExpression = finishNode(factory2.createJSDocSignature(void 0, parameters, returnTag), start2);
23673
+ return finishNode(factory2.createJSDocSignature(void 0, parameters, returnTag), start2);
23674
+ }
23675
+ function parseCallbackTag(start2, tagName, indent2, indentText) {
23676
+ const fullName = parseJSDocTypeNameWithNamespace();
23677
+ skipWhitespace();
23678
+ let comment = parseTagComments(indent2);
23679
+ const typeExpression = parseJSDocSignature(start2, indent2);
23215
23680
  if (!comment) {
23216
23681
  comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
23217
23682
  }
23218
23683
  const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
23219
23684
  return finishNode(factory2.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start2, end2);
23220
23685
  }
23686
+ function parseOverloadTag(start2, tagName, indent2, indentText) {
23687
+ skipWhitespace();
23688
+ let comment = parseTagComments(indent2);
23689
+ const typeExpression = parseJSDocSignature(start2, indent2);
23690
+ if (!comment) {
23691
+ comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
23692
+ }
23693
+ const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
23694
+ return finishNode(factory2.createJSDocOverloadTag(tagName, typeExpression, comment), start2, end2);
23695
+ }
23221
23696
  function escapedTextsEqual(a, b) {
23222
23697
  while (!isIdentifier(a) || !isIdentifier(b)) {
23223
23698
  if (!isIdentifier(a) && !isIdentifier(b) && a.right.escapedText === b.right.escapedText) {
@@ -23240,7 +23715,7 @@ var Parser;
23240
23715
  case 59 /* AtToken */:
23241
23716
  if (canParseTag) {
23242
23717
  const child = tryParseChildTag(target, indent2);
23243
- if (child && (child.kind === 343 /* JSDocParameterTag */ || child.kind === 350 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
23718
+ if (child && (child.kind === 344 /* JSDocParameterTag */ || child.kind === 351 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
23244
23719
  return false;
23245
23720
  }
23246
23721
  return child;
@@ -24700,7 +25175,8 @@ var commandOptionsWithoutBuild = [
24700
25175
  node: 2 /* NodeJs */,
24701
25176
  classic: 1 /* Classic */,
24702
25177
  node16: 3 /* Node16 */,
24703
- nodenext: 99 /* NodeNext */
25178
+ nodenext: 99 /* NodeNext */,
25179
+ bundler: 100 /* Bundler */
24704
25180
  })),
24705
25181
  affectsModuleResolution: true,
24706
25182
  paramType: Diagnostics.STRATEGY,
@@ -24813,6 +25289,41 @@ var commandOptionsWithoutBuild = [
24813
25289
  category: Diagnostics.Modules,
24814
25290
  description: Diagnostics.List_of_file_name_suffixes_to_search_when_resolving_a_module
24815
25291
  },
25292
+ {
25293
+ name: "allowImportingTsExtensions",
25294
+ type: "boolean",
25295
+ affectsModuleResolution: true,
25296
+ category: Diagnostics.Modules,
25297
+ description: Diagnostics.Allow_imports_to_include_TypeScript_file_extensions_Requires_moduleResolution_bundler_and_either_noEmit_or_emitDeclarationOnly_to_be_set,
25298
+ defaultValueDescription: false
25299
+ },
25300
+ {
25301
+ name: "resolvePackageJsonExports",
25302
+ type: "boolean",
25303
+ affectsModuleResolution: true,
25304
+ category: Diagnostics.Modules,
25305
+ description: Diagnostics.Use_the_package_json_exports_field_when_resolving_package_imports,
25306
+ defaultValueDescription: Diagnostics.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false
25307
+ },
25308
+ {
25309
+ name: "resolvePackageJsonImports",
25310
+ type: "boolean",
25311
+ affectsModuleResolution: true,
25312
+ category: Diagnostics.Modules,
25313
+ description: Diagnostics.Use_the_package_json_imports_field_when_resolving_imports,
25314
+ defaultValueDescription: Diagnostics.true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false
25315
+ },
25316
+ {
25317
+ name: "customConditions",
25318
+ type: "list",
25319
+ element: {
25320
+ name: "condition",
25321
+ type: "string"
25322
+ },
25323
+ affectsModuleResolution: true,
25324
+ category: Diagnostics.Modules,
25325
+ description: Diagnostics.Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports
25326
+ },
24816
25327
  {
24817
25328
  name: "sourceRoot",
24818
25329
  type: "string",
@@ -25386,6 +25897,15 @@ var commandLineTypeAcquisitionMapCache;
25386
25897
  function getCommandLineTypeAcquisitionMap() {
25387
25898
  return commandLineTypeAcquisitionMapCache || (commandLineTypeAcquisitionMapCache = commandLineOptionsToMap(typeAcquisitionDeclarations));
25388
25899
  }
25900
+ var extendsOptionDeclaration = {
25901
+ name: "extends",
25902
+ type: "listOrElement",
25903
+ element: {
25904
+ name: "extends",
25905
+ type: "string"
25906
+ },
25907
+ category: Diagnostics.File_Management
25908
+ };
25389
25909
  var _tsconfigRootOptions;
25390
25910
  function getTsconfigRootOptionsMap() {
25391
25911
  if (_tsconfigRootOptions === void 0) {
@@ -25417,11 +25937,7 @@ function getTsconfigRootOptionsMap() {
25417
25937
  elementOptions: getCommandLineTypeAcquisitionMap(),
25418
25938
  extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics
25419
25939
  },
25420
- {
25421
- name: "extends",
25422
- type: "string",
25423
- category: Diagnostics.File_Management
25424
- },
25940
+ extendsOptionDeclaration,
25425
25941
  {
25426
25942
  name: "references",
25427
25943
  type: "list",
@@ -25556,10 +26072,10 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
25556
26072
  let invalidReported;
25557
26073
  switch (valueExpression.kind) {
25558
26074
  case 110 /* TrueKeyword */:
25559
- reportInvalidOptionValue(option && option.type !== "boolean");
26075
+ reportInvalidOptionValue(option && option.type !== "boolean" && (option.type !== "listOrElement" || option.element.type !== "boolean"));
25560
26076
  return validateValue(true);
25561
26077
  case 95 /* FalseKeyword */:
25562
- reportInvalidOptionValue(option && option.type !== "boolean");
26078
+ reportInvalidOptionValue(option && option.type !== "boolean" && (option.type !== "listOrElement" || option.element.type !== "boolean"));
25563
26079
  return validateValue(false);
25564
26080
  case 104 /* NullKeyword */:
25565
26081
  reportInvalidOptionValue(option && option.name === "extends");
@@ -25568,8 +26084,11 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
25568
26084
  if (!isDoubleQuotedString(valueExpression)) {
25569
26085
  errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.String_literal_with_double_quotes_expected));
25570
26086
  }
25571
- reportInvalidOptionValue(option && (isString(option.type) && option.type !== "string"));
26087
+ reportInvalidOptionValue(option && isString(option.type) && option.type !== "string" && (option.type !== "listOrElement" || isString(option.element.type) && option.element.type !== "string"));
25572
26088
  const text = valueExpression.text;
26089
+ if (option) {
26090
+ Debug.assert(option.type !== "listOrElement" || option.element.type === "string", "Only string or array of string is handled for now");
26091
+ }
25573
26092
  if (option && !isString(option.type)) {
25574
26093
  const customOption = option;
25575
26094
  if (!customOption.type.has(text.toLowerCase())) {
@@ -25584,16 +26103,16 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
25584
26103
  }
25585
26104
  return validateValue(text);
25586
26105
  case 8 /* NumericLiteral */:
25587
- reportInvalidOptionValue(option && option.type !== "number");
26106
+ reportInvalidOptionValue(option && option.type !== "number" && (option.type !== "listOrElement" || option.element.type !== "number"));
25588
26107
  return validateValue(Number(valueExpression.text));
25589
26108
  case 221 /* PrefixUnaryExpression */:
25590
26109
  if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
25591
26110
  break;
25592
26111
  }
25593
- reportInvalidOptionValue(option && option.type !== "number");
26112
+ reportInvalidOptionValue(option && option.type !== "number" && (option.type !== "listOrElement" || option.element.type !== "number"));
25594
26113
  return validateValue(-Number(valueExpression.operand.text));
25595
26114
  case 207 /* ObjectLiteralExpression */:
25596
- reportInvalidOptionValue(option && option.type !== "object");
26115
+ reportInvalidOptionValue(option && option.type !== "object" && (option.type !== "listOrElement" || option.element.type !== "object"));
25597
26116
  const objectLiteralExpression = valueExpression;
25598
26117
  if (option) {
25599
26118
  const { elementOptions, extraKeyDiagnostics, name: optionName } = option;
@@ -25612,7 +26131,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
25612
26131
  ));
25613
26132
  }
25614
26133
  case 206 /* ArrayLiteralExpression */:
25615
- reportInvalidOptionValue(option && option.type !== "list");
26134
+ reportInvalidOptionValue(option && option.type !== "list" && option.type !== "listOrElement");
25616
26135
  return validateValue(convertArrayLiteralExpressionToJson(
25617
26136
  valueExpression.elements,
25618
26137
  option && option.element
@@ -25647,7 +26166,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
25647
26166
  }
25648
26167
  }
25649
26168
  function getCompilerOptionValueTypeString(option) {
25650
- return option.type === "list" ? "Array" : isString(option.type) ? option.type : "string";
26169
+ return option.type === "listOrElement" ? `${getCompilerOptionValueTypeString(option.element)} or Array` : option.type === "list" ? "Array" : isString(option.type) ? option.type : "string";
25651
26170
  }
25652
26171
  function isCompilerOptionsValue(option, value) {
25653
26172
  if (option) {
@@ -25656,6 +26175,9 @@ function isCompilerOptionsValue(option, value) {
25656
26175
  if (option.type === "list") {
25657
26176
  return isArray(value);
25658
26177
  }
26178
+ if (option.type === "listOrElement") {
26179
+ return isArray(value) || isCompilerOptionsValue(option.element, value);
26180
+ }
25659
26181
  const expectedType = isString(option.type) ? option.type : "string";
25660
26182
  return typeof value === expectedType;
25661
26183
  }
@@ -25717,7 +26239,7 @@ function withPackageId(packageInfo, r) {
25717
26239
  };
25718
26240
  }
25719
26241
  }
25720
- return r && { path: r.path, extension: r.ext, packageId };
26242
+ return r && { path: r.path, extension: r.ext, packageId, resolvedUsingTsExtension: r.resolvedUsingTsExtension };
25721
26243
  }
25722
26244
  function noPackageId(r) {
25723
26245
  return withPackageId(void 0, r);
@@ -25725,7 +26247,7 @@ function noPackageId(r) {
25725
26247
  function removeIgnoredPackageId(r) {
25726
26248
  if (r) {
25727
26249
  Debug.assert(r.packageId === void 0);
25728
- return { path: r.path, ext: r.extension };
26250
+ return { path: r.path, ext: r.extension, resolvedUsingTsExtension: r.resolvedUsingTsExtension };
25729
26251
  }
25730
26252
  }
25731
26253
  function formatExtensions(extensions) {
@@ -25748,7 +26270,14 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra
25748
26270
  return resultFromCache;
25749
26271
  }
25750
26272
  return {
25751
- resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? void 0 : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport, packageId: resolved.packageId },
26273
+ resolvedModule: resolved && {
26274
+ resolvedFileName: resolved.path,
26275
+ originalPath: resolved.originalPath === true ? void 0 : resolved.originalPath,
26276
+ extension: resolved.extension,
26277
+ isExternalLibraryImport,
26278
+ packageId: resolved.packageId,
26279
+ resolvedUsingTsExtension: !!resolved.resolvedUsingTsExtension
26280
+ },
25752
26281
  failedLookupLocations: initializeResolutionField(failedLookupLocations),
25753
26282
  affectingLocations: initializeResolutionField(affectingLocations),
25754
26283
  resolutionDiagnostics: initializeResolutionField(diagnostics)
@@ -25864,6 +26393,38 @@ function arePathsEqual(path1, path2, host) {
25864
26393
  const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
25865
26394
  return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */;
25866
26395
  }
26396
+ function getNodeResolutionFeatures(options) {
26397
+ let features = NodeResolutionFeatures.None;
26398
+ switch (getEmitModuleResolutionKind(options)) {
26399
+ case 3 /* Node16 */:
26400
+ features = NodeResolutionFeatures.Node16Default;
26401
+ break;
26402
+ case 99 /* NodeNext */:
26403
+ features = NodeResolutionFeatures.NodeNextDefault;
26404
+ break;
26405
+ case 100 /* Bundler */:
26406
+ features = NodeResolutionFeatures.BundlerDefault;
26407
+ break;
26408
+ }
26409
+ if (options.resolvePackageJsonExports) {
26410
+ features |= NodeResolutionFeatures.Exports;
26411
+ } else if (options.resolvePackageJsonExports === false) {
26412
+ features &= ~NodeResolutionFeatures.Exports;
26413
+ }
26414
+ if (options.resolvePackageJsonImports) {
26415
+ features |= NodeResolutionFeatures.Imports;
26416
+ } else if (options.resolvePackageJsonImports === false) {
26417
+ features &= ~NodeResolutionFeatures.Imports;
26418
+ }
26419
+ return features;
26420
+ }
26421
+ function getConditions(options, esmMode) {
26422
+ const conditions = esmMode || getEmitModuleResolutionKind(options) === 100 /* Bundler */ ? ["node", "import"] : ["node", "require"];
26423
+ if (!options.noDtsResolution) {
26424
+ conditions.push("types");
26425
+ }
26426
+ return concatenate(conditions, options.customConditions);
26427
+ }
25867
26428
  function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
25868
26429
  const traceEnabled = isTraceEnabled(compilerOptions, host);
25869
26430
  if (redirectedReference) {
@@ -25920,6 +26481,9 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
25920
26481
  case 1 /* Classic */:
25921
26482
  result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
25922
26483
  break;
26484
+ case 100 /* Bundler */:
26485
+ result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
26486
+ break;
25923
26487
  default:
25924
26488
  return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
25925
26489
  }
@@ -26049,6 +26613,19 @@ function resolveJSModule(moduleName, initialDir, host) {
26049
26613
  }
26050
26614
  return resolvedModule.resolvedFileName;
26051
26615
  }
26616
+ var NodeResolutionFeatures = /* @__PURE__ */ ((NodeResolutionFeatures2) => {
26617
+ NodeResolutionFeatures2[NodeResolutionFeatures2["None"] = 0] = "None";
26618
+ NodeResolutionFeatures2[NodeResolutionFeatures2["Imports"] = 2] = "Imports";
26619
+ NodeResolutionFeatures2[NodeResolutionFeatures2["SelfName"] = 4] = "SelfName";
26620
+ NodeResolutionFeatures2[NodeResolutionFeatures2["Exports"] = 8] = "Exports";
26621
+ NodeResolutionFeatures2[NodeResolutionFeatures2["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
26622
+ NodeResolutionFeatures2[NodeResolutionFeatures2["AllFeatures"] = 30] = "AllFeatures";
26623
+ NodeResolutionFeatures2[NodeResolutionFeatures2["Node16Default"] = 30] = "Node16Default";
26624
+ NodeResolutionFeatures2[NodeResolutionFeatures2["NodeNextDefault"] = 30 /* AllFeatures */] = "NodeNextDefault";
26625
+ NodeResolutionFeatures2[NodeResolutionFeatures2["BundlerDefault"] = 30] = "BundlerDefault";
26626
+ NodeResolutionFeatures2[NodeResolutionFeatures2["EsmMode"] = 32] = "EsmMode";
26627
+ return NodeResolutionFeatures2;
26628
+ })(NodeResolutionFeatures || {});
26052
26629
  function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
26053
26630
  return nodeNextModuleNameResolverWorker(
26054
26631
  30 /* Node16Default */,
@@ -26077,7 +26654,7 @@ function nodeNextModuleNameResolverWorker(features, moduleName, containingFile,
26077
26654
  const containingDirectory = getDirectoryPath(containingFile);
26078
26655
  const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
26079
26656
  let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
26080
- if (compilerOptions.resolveJsonModule) {
26657
+ if (getResolveJsonModule(compilerOptions)) {
26081
26658
  extensions |= 8 /* Json */;
26082
26659
  }
26083
26660
  return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, false, redirectedReference);
@@ -26095,16 +26672,24 @@ function tryResolveJSModuleWorker(moduleName, initialDir, host) {
26095
26672
  void 0
26096
26673
  );
26097
26674
  }
26675
+ function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
26676
+ const containingDirectory = getDirectoryPath(containingFile);
26677
+ let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
26678
+ if (getResolveJsonModule(compilerOptions)) {
26679
+ extensions |= 8 /* Json */;
26680
+ }
26681
+ return nodeModuleNameResolverWorker(getNodeResolutionFeatures(compilerOptions), moduleName, containingDirectory, compilerOptions, host, cache, extensions, false, redirectedReference);
26682
+ }
26098
26683
  function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
26099
26684
  let extensions;
26100
26685
  if (isConfigLookup) {
26101
26686
  extensions = 8 /* Json */;
26102
26687
  } else if (compilerOptions.noDtsResolution) {
26103
26688
  extensions = 3 /* ImplementationFiles */;
26104
- if (compilerOptions.resolveJsonModule)
26689
+ if (getResolveJsonModule(compilerOptions))
26105
26690
  extensions |= 8 /* Json */;
26106
26691
  } else {
26107
- extensions = compilerOptions.resolveJsonModule ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
26692
+ extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
26108
26693
  }
26109
26694
  return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
26110
26695
  }
@@ -26113,10 +26698,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
26113
26698
  const traceEnabled = isTraceEnabled(compilerOptions, host);
26114
26699
  const failedLookupLocations = [];
26115
26700
  const affectingLocations = [];
26116
- const conditions = features & 32 /* EsmMode */ ? ["node", "import", "types"] : ["node", "require", "types"];
26117
- if (compilerOptions.noDtsResolution) {
26118
- conditions.pop();
26119
- }
26701
+ const conditions = getConditions(compilerOptions, !!(features & 32 /* EsmMode */));
26120
26702
  const diagnostics = [];
26121
26703
  const state = {
26122
26704
  compilerOptions,
@@ -26277,7 +26859,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
26277
26859
  }
26278
26860
  }
26279
26861
  function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
26280
- if (hasJSFileExtension(candidate) || extensions & 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */)) {
26862
+ if (hasJSFileExtension(candidate) || extensions & 8 /* Json */ && fileExtensionIs(candidate, ".json" /* Json */) || extensions & (1 /* TypeScript */ | 4 /* Declaration */) && moduleResolutionSupportsResolvingTsExtensions(state.compilerOptions) && fileExtensionIsOneOf(candidate, supportedTSExtensionsFlat)) {
26281
26863
  const extensionless = removeFileExtension(candidate);
26282
26864
  const extension = candidate.substring(extensionless.length);
26283
26865
  if (state.traceEnabled) {
@@ -26289,7 +26871,7 @@ function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecor
26289
26871
  function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
26290
26872
  if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
26291
26873
  const result = tryFile(candidate, onlyRecordFailures, state);
26292
- return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate) } : void 0;
26874
+ return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate), resolvedUsingTsExtension: void 0 } : void 0;
26293
26875
  }
26294
26876
  return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
26295
26877
  }
@@ -26324,12 +26906,18 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
26324
26906
  return result;
26325
26907
  }
26326
26908
  return void 0;
26909
+ case ".ts" /* Ts */:
26910
+ case ".tsx" /* Tsx */:
26911
+ case ".d.ts" /* Dts */:
26912
+ if (moduleResolutionSupportsResolvingTsExtensions(state.compilerOptions) && extensionIsOk(extensions, originalExtension)) {
26913
+ return tryExtension(originalExtension, true);
26914
+ }
26327
26915
  default:
26328
26916
  return extensions & 1 /* TypeScript */ && (tryExtension(".ts" /* Ts */) || tryExtension(".tsx" /* Tsx */)) || extensions & 4 /* Declaration */ && tryExtension(".d.ts" /* Dts */) || extensions & 2 /* JavaScript */ && (tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */)) || state.isConfigLookup && tryExtension(".json" /* Json */) || void 0;
26329
26917
  }
26330
- function tryExtension(ext) {
26918
+ function tryExtension(ext, resolvedUsingTsExtension) {
26331
26919
  const path2 = tryFile(candidate + ext, onlyRecordFailures, state);
26332
- return path2 === void 0 ? void 0 : { path: path2, ext };
26920
+ return path2 === void 0 ? void 0 : { path: path2, ext, resolvedUsingTsExtension };
26333
26921
  }
26334
26922
  }
26335
26923
  function tryFile(fileName, onlyRecordFailures, state) {
@@ -26470,9 +27058,9 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
26470
27058
  return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
26471
27059
  }
26472
27060
  }
26473
- function resolvedIfExtensionMatches(extensions, path2) {
27061
+ function resolvedIfExtensionMatches(extensions, path2, resolvedUsingTsExtension) {
26474
27062
  const ext = tryGetExtensionFromPath2(path2);
26475
- return ext !== void 0 && extensionIsOk(extensions, ext) ? { path: path2, ext } : void 0;
27063
+ return ext !== void 0 && extensionIsOk(extensions, ext) ? { path: path2, ext, resolvedUsingTsExtension } : void 0;
26476
27064
  }
26477
27065
  function extensionIsOk(extensions, extension) {
26478
27066
  return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
@@ -26638,7 +27226,13 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
26638
27226
  traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup);
26639
27227
  traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/");
26640
27228
  const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, extensions, false, redirectedReference);
26641
- return toSearchResult(result.resolvedModule ? { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId, originalPath: result.resolvedModule.originalPath } : void 0);
27229
+ return toSearchResult(result.resolvedModule ? {
27230
+ path: result.resolvedModule.resolvedFileName,
27231
+ extension: result.resolvedModule.extension,
27232
+ packageId: result.resolvedModule.packageId,
27233
+ originalPath: result.resolvedModule.originalPath,
27234
+ resolvedUsingTsExtension: result.resolvedModule.resolvedUsingTsExtension
27235
+ } : void 0);
26642
27236
  }
26643
27237
  if (state.traceEnabled) {
26644
27238
  trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
@@ -26933,7 +27527,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
26933
27527
  if (extension !== void 0) {
26934
27528
  const path3 = tryFile(candidate, onlyRecordFailures, state);
26935
27529
  if (path3 !== void 0) {
26936
- return noPackageId({ path: path3, ext: extension });
27530
+ return noPackageId({ path: path3, ext: extension, resolvedUsingTsExtension: void 0 });
26937
27531
  }
26938
27532
  }
26939
27533
  return loader(extensions, candidate, onlyRecordFailures || !directoryProbablyExists(getDirectoryPath(candidate), state.host), state);
@@ -26965,7 +27559,15 @@ function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containing
26965
27559
  trace(state.host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
26966
27560
  }
26967
27561
  state.resultFromCache = result;
26968
- return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, originalPath: result.resolvedModule.originalPath || true, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } };
27562
+ return {
27563
+ value: result.resolvedModule && {
27564
+ path: result.resolvedModule.resolvedFileName,
27565
+ originalPath: result.resolvedModule.originalPath || true,
27566
+ extension: result.resolvedModule.extension,
27567
+ packageId: result.resolvedModule.packageId,
27568
+ resolvedUsingTsExtension: result.resolvedModule.resolvedUsingTsExtension
27569
+ }
27570
+ };
26969
27571
  }
26970
27572
  }
26971
27573
  function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
@@ -27022,6 +27624,9 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
27022
27624
  }
27023
27625
  }
27024
27626
  }
27627
+ function moduleResolutionSupportsResolvingTsExtensions(compilerOptions) {
27628
+ return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
27629
+ }
27025
27630
  function toSearchResult(value) {
27026
27631
  return value !== void 0 ? { value } : void 0;
27027
27632
  }
@@ -27392,13 +27997,14 @@ function createBinder() {
27392
27997
  if (node.kind === 278 /* ExportSpecifier */ || node.kind === 268 /* ImportEqualsDeclaration */ && hasExportModifier) {
27393
27998
  return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
27394
27999
  } else {
28000
+ Debug.assertNode(container, canHaveLocals);
27395
28001
  return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
27396
28002
  }
27397
28003
  } else {
27398
28004
  if (isJSDocTypeAlias(node))
27399
28005
  Debug.assert(isInJSFile(node));
27400
28006
  if (!isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) {
27401
- if (!container.locals || hasSyntacticModifier(node, 1024 /* Default */) && !getDeclarationName(node)) {
28007
+ if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node, 1024 /* Default */) && !getDeclarationName(node)) {
27402
28008
  return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
27403
28009
  }
27404
28010
  const exportKind = symbolFlags & 111551 /* Value */ ? 1048576 /* ExportValue */ : 0;
@@ -27407,6 +28013,7 @@ function createBinder() {
27407
28013
  node.localSymbol = local;
27408
28014
  return local;
27409
28015
  } else {
28016
+ Debug.assertNode(container, canHaveLocals);
27410
28017
  return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
27411
28018
  }
27412
28019
  }
@@ -27439,11 +28046,13 @@ function createBinder() {
27439
28046
  container = blockScopeContainer = node;
27440
28047
  if (containerFlags & 32 /* HasLocals */) {
27441
28048
  container.locals = createSymbolTable();
28049
+ addToContainerChain(container);
27442
28050
  }
27443
- addToContainerChain(container);
27444
28051
  } else if (containerFlags & 2 /* IsBlockScopedContainer */) {
27445
28052
  blockScopeContainer = node;
27446
- blockScopeContainer.locals = void 0;
28053
+ if (containerFlags & 32 /* HasLocals */) {
28054
+ blockScopeContainer.locals = void 0;
28055
+ }
27447
28056
  }
27448
28057
  if (containerFlags & 4 /* IsControlFlowContainer */) {
27449
28058
  const saveCurrentFlow = currentFlow;
@@ -27606,9 +28215,9 @@ function createBinder() {
27606
28215
  case 232 /* NonNullExpression */:
27607
28216
  bindNonNullExpressionFlow(node);
27608
28217
  break;
27609
- case 348 /* JSDocTypedefTag */:
28218
+ case 349 /* JSDocTypedefTag */:
27610
28219
  case 341 /* JSDocCallbackTag */:
27611
- case 342 /* JSDocEnumTag */:
28220
+ case 343 /* JSDocEnumTag */:
27612
28221
  bindJSDocTypeAlias(node);
27613
28222
  break;
27614
28223
  case 308 /* SourceFile */: {
@@ -28311,7 +28920,7 @@ function createBinder() {
28311
28920
  }
28312
28921
  function bindJSDocTypeAlias(node) {
28313
28922
  bind(node.tagName);
28314
- if (node.kind !== 342 /* JSDocEnumTag */ && node.fullName) {
28923
+ if (node.kind !== 343 /* JSDocEnumTag */ && node.fullName) {
28315
28924
  setParent(node.fullName, node);
28316
28925
  setParentRecursive(node.fullName, false);
28317
28926
  }
@@ -28408,60 +29017,6 @@ function createBinder() {
28408
29017
  }
28409
29018
  }
28410
29019
  }
28411
- function getContainerFlags(node) {
28412
- switch (node.kind) {
28413
- case 228 /* ClassExpression */:
28414
- case 260 /* ClassDeclaration */:
28415
- case 263 /* EnumDeclaration */:
28416
- case 207 /* ObjectLiteralExpression */:
28417
- case 184 /* TypeLiteral */:
28418
- case 325 /* JSDocTypeLiteral */:
28419
- case 289 /* JsxAttributes */:
28420
- return 1 /* IsContainer */;
28421
- case 261 /* InterfaceDeclaration */:
28422
- return 1 /* IsContainer */ | 64 /* IsInterface */;
28423
- case 264 /* ModuleDeclaration */:
28424
- case 262 /* TypeAliasDeclaration */:
28425
- case 197 /* MappedType */:
28426
- case 178 /* IndexSignature */:
28427
- return 1 /* IsContainer */ | 32 /* HasLocals */;
28428
- case 308 /* SourceFile */:
28429
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
28430
- case 174 /* GetAccessor */:
28431
- case 175 /* SetAccessor */:
28432
- case 171 /* MethodDeclaration */:
28433
- if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
28434
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
28435
- }
28436
- case 173 /* Constructor */:
28437
- case 259 /* FunctionDeclaration */:
28438
- case 170 /* MethodSignature */:
28439
- case 176 /* CallSignature */:
28440
- case 326 /* JSDocSignature */:
28441
- case 320 /* JSDocFunctionType */:
28442
- case 181 /* FunctionType */:
28443
- case 177 /* ConstructSignature */:
28444
- case 182 /* ConstructorType */:
28445
- case 172 /* ClassStaticBlockDeclaration */:
28446
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
28447
- case 215 /* FunctionExpression */:
28448
- case 216 /* ArrowFunction */:
28449
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
28450
- case 265 /* ModuleBlock */:
28451
- return 4 /* IsControlFlowContainer */;
28452
- case 169 /* PropertyDeclaration */:
28453
- return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
28454
- case 295 /* CatchClause */:
28455
- case 245 /* ForStatement */:
28456
- case 246 /* ForInStatement */:
28457
- case 247 /* ForOfStatement */:
28458
- case 266 /* CaseBlock */:
28459
- return 2 /* IsBlockScopedContainer */;
28460
- case 238 /* Block */:
28461
- return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;
28462
- }
28463
- return 0 /* None */;
28464
- }
28465
29020
  function addToContainerChain(next) {
28466
29021
  if (lastContainer) {
28467
29022
  lastContainer.nextContainer = next;
@@ -28500,11 +29055,11 @@ function createBinder() {
28500
29055
  case 215 /* FunctionExpression */:
28501
29056
  case 216 /* ArrowFunction */:
28502
29057
  case 320 /* JSDocFunctionType */:
28503
- case 348 /* JSDocTypedefTag */:
28504
- case 341 /* JSDocCallbackTag */:
28505
29058
  case 172 /* ClassStaticBlockDeclaration */:
28506
29059
  case 262 /* TypeAliasDeclaration */:
28507
29060
  case 197 /* MappedType */:
29061
+ if (container.locals)
29062
+ Debug.assertNode(container, canHaveLocals);
28508
29063
  return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
28509
29064
  }
28510
29065
  }
@@ -28599,6 +29154,7 @@ function createBinder() {
28599
29154
  break;
28600
29155
  }
28601
29156
  default:
29157
+ Debug.assertNode(blockScopeContainer, canHaveLocals);
28602
29158
  if (!blockScopeContainer.locals) {
28603
29159
  blockScopeContainer.locals = createSymbolTable();
28604
29160
  addToContainerChain(blockScopeContainer);
@@ -29108,21 +29664,23 @@ function createBinder() {
29108
29664
  }
29109
29665
  case 265 /* ModuleBlock */:
29110
29666
  return updateStrictModeStatementList(node.statements);
29111
- case 343 /* JSDocParameterTag */:
29667
+ case 344 /* JSDocParameterTag */:
29112
29668
  if (node.parent.kind === 326 /* JSDocSignature */) {
29113
29669
  return bindParameter(node);
29114
29670
  }
29115
29671
  if (node.parent.kind !== 325 /* JSDocTypeLiteral */) {
29116
29672
  break;
29117
29673
  }
29118
- case 350 /* JSDocPropertyTag */:
29674
+ case 351 /* JSDocPropertyTag */:
29119
29675
  const propTag = node;
29120
29676
  const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 319 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
29121
29677
  return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);
29122
- case 348 /* JSDocTypedefTag */:
29678
+ case 349 /* JSDocTypedefTag */:
29123
29679
  case 341 /* JSDocCallbackTag */:
29124
- case 342 /* JSDocEnumTag */:
29680
+ case 343 /* JSDocEnumTag */:
29125
29681
  return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
29682
+ case 342 /* JSDocOverloadTag */:
29683
+ return bind(node.typeExpression);
29126
29684
  }
29127
29685
  }
29128
29686
  function bindPropertyWorker(node) {
@@ -29255,7 +29813,7 @@ function createBinder() {
29255
29813
  if (hasPrivateIdentifier) {
29256
29814
  return;
29257
29815
  }
29258
- const thisContainer = getThisContainer(node, false);
29816
+ const thisContainer = getThisContainer(node, false, false);
29259
29817
  switch (thisContainer.kind) {
29260
29818
  case 259 /* FunctionDeclaration */:
29261
29819
  case 215 /* FunctionExpression */:
@@ -29519,7 +30077,7 @@ function createBinder() {
29519
30077
  }
29520
30078
  if (!isBindingPattern(node.name)) {
29521
30079
  const possibleVariableDecl = node.kind === 257 /* VariableDeclaration */ ? node : node.parent.parent;
29522
- if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) {
30080
+ if (isInJSFile(node) && getEmitModuleResolutionKind(options) !== 100 /* Bundler */ && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) {
29523
30081
  declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
29524
30082
  } else if (isBlockOrCatchScoped(node)) {
29525
30083
  bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);
@@ -29531,7 +30089,7 @@ function createBinder() {
29531
30089
  }
29532
30090
  }
29533
30091
  function bindParameter(node) {
29534
- if (node.kind === 343 /* JSDocParameterTag */ && container.kind !== 326 /* JSDocSignature */) {
30092
+ if (node.kind === 344 /* JSDocParameterTag */ && container.kind !== 326 /* JSDocSignature */) {
29535
30093
  return;
29536
30094
  }
29537
30095
  if (inStrictMode && !(node.flags & 16777216 /* Ambient */)) {
@@ -29588,12 +30146,12 @@ function createBinder() {
29588
30146
  return extendsType && extendsType.parent;
29589
30147
  }
29590
30148
  function bindTypeParameter(node) {
30149
+ var _a2, _b;
29591
30150
  if (isJSDocTemplateTag(node.parent)) {
29592
30151
  const container2 = getEffectiveContainerForJSDocTemplateTag(node.parent);
29593
30152
  if (container2) {
29594
- if (!container2.locals) {
29595
- container2.locals = createSymbolTable();
29596
- }
30153
+ Debug.assertNode(container2, canHaveLocals);
30154
+ (_a2 = container2.locals) != null ? _a2 : container2.locals = createSymbolTable();
29597
30155
  declareSymbol(container2.locals, void 0, node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
29598
30156
  } else {
29599
30157
  declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
@@ -29601,9 +30159,8 @@ function createBinder() {
29601
30159
  } else if (node.parent.kind === 192 /* InferType */) {
29602
30160
  const container2 = getInferTypeContainer(node.parent);
29603
30161
  if (container2) {
29604
- if (!container2.locals) {
29605
- container2.locals = createSymbolTable();
29606
- }
30162
+ Debug.assertNode(container2, canHaveLocals);
30163
+ (_b = container2.locals) != null ? _b : container2.locals = createSymbolTable();
29607
30164
  declareSymbol(container2.locals, void 0, node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
29608
30165
  } else {
29609
30166
  bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node));
@@ -29681,15 +30238,72 @@ function isExportsOrModuleExportsOrAlias(sourceFile, node) {
29681
30238
  }
29682
30239
  return false;
29683
30240
  }
30241
+ function getContainerFlags(node) {
30242
+ switch (node.kind) {
30243
+ case 228 /* ClassExpression */:
30244
+ case 260 /* ClassDeclaration */:
30245
+ case 263 /* EnumDeclaration */:
30246
+ case 207 /* ObjectLiteralExpression */:
30247
+ case 184 /* TypeLiteral */:
30248
+ case 325 /* JSDocTypeLiteral */:
30249
+ case 289 /* JsxAttributes */:
30250
+ return 1 /* IsContainer */;
30251
+ case 261 /* InterfaceDeclaration */:
30252
+ return 1 /* IsContainer */ | 64 /* IsInterface */;
30253
+ case 264 /* ModuleDeclaration */:
30254
+ case 262 /* TypeAliasDeclaration */:
30255
+ case 197 /* MappedType */:
30256
+ case 178 /* IndexSignature */:
30257
+ return 1 /* IsContainer */ | 32 /* HasLocals */;
30258
+ case 308 /* SourceFile */:
30259
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
30260
+ case 174 /* GetAccessor */:
30261
+ case 175 /* SetAccessor */:
30262
+ case 171 /* MethodDeclaration */:
30263
+ if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
30264
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
30265
+ }
30266
+ case 173 /* Constructor */:
30267
+ case 259 /* FunctionDeclaration */:
30268
+ case 170 /* MethodSignature */:
30269
+ case 176 /* CallSignature */:
30270
+ case 326 /* JSDocSignature */:
30271
+ case 320 /* JSDocFunctionType */:
30272
+ case 181 /* FunctionType */:
30273
+ case 177 /* ConstructSignature */:
30274
+ case 182 /* ConstructorType */:
30275
+ case 172 /* ClassStaticBlockDeclaration */:
30276
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
30277
+ case 215 /* FunctionExpression */:
30278
+ case 216 /* ArrowFunction */:
30279
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
30280
+ case 265 /* ModuleBlock */:
30281
+ return 4 /* IsControlFlowContainer */;
30282
+ case 169 /* PropertyDeclaration */:
30283
+ return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
30284
+ case 295 /* CatchClause */:
30285
+ case 245 /* ForStatement */:
30286
+ case 246 /* ForInStatement */:
30287
+ case 247 /* ForOfStatement */:
30288
+ case 266 /* CaseBlock */:
30289
+ return 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */;
30290
+ case 238 /* Block */:
30291
+ return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */ | 32 /* HasLocals */;
30292
+ }
30293
+ return 0 /* None */;
30294
+ }
29684
30295
  function lookupSymbolForName(container, name) {
29685
- const local = container.locals && container.locals.get(name);
30296
+ var _a2, _b, _c, _d, _e;
30297
+ const local = (_b = (_a2 = tryCast(container, canHaveLocals)) == null ? void 0 : _a2.locals) == null ? void 0 : _b.get(name);
29686
30298
  if (local) {
29687
- return local.exportSymbol || local;
30299
+ return (_c = local.exportSymbol) != null ? _c : local;
29688
30300
  }
29689
30301
  if (isSourceFile(container) && container.jsGlobalAugmentations && container.jsGlobalAugmentations.has(name)) {
29690
30302
  return container.jsGlobalAugmentations.get(name);
29691
30303
  }
29692
- return container.symbol && container.symbol.exports && container.symbol.exports.get(name);
30304
+ if (canHaveSymbol(container)) {
30305
+ return (_e = (_d = container.symbol) == null ? void 0 : _d.exports) == null ? void 0 : _e.get(name);
30306
+ }
29693
30307
  }
29694
30308
 
29695
30309
  // src/compiler/checker.ts
@@ -31066,13 +31680,13 @@ var visitEachChildTable = {
31066
31680
  visitLexicalEnvironment(node.statements, visitor, context)
31067
31681
  );
31068
31682
  },
31069
- [353 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
31683
+ [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
31070
31684
  return context.factory.updatePartiallyEmittedExpression(
31071
31685
  node,
31072
31686
  nodeVisitor(node.expression, visitor, isExpression)
31073
31687
  );
31074
31688
  },
31075
- [354 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
31689
+ [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
31076
31690
  return context.factory.updateCommaListExpression(
31077
31691
  node,
31078
31692
  nodesVisitor(node.elements, visitor, isExpression)