typescript 5.0.0-dev.20221213 → 5.0.0-dev.20221215
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.
- package/lib/tsc.js +2252 -1337
- package/lib/tsserver.js +2712 -1563
- package/lib/tsserverlibrary.d.ts +118 -86
- package/lib/tsserverlibrary.js +2696 -1566
- package/lib/typescript.d.ts +117 -86
- package/lib/typescript.js +2675 -1565
- package/lib/typingsInstaller.js +1370 -773
- package/package.json +2 -2
package/lib/typingsInstaller.js
CHANGED
|
@@ -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.
|
|
53
|
+
var version = `${versionMajorMinor}.0-dev.20221215`;
|
|
54
54
|
|
|
55
55
|
// src/compiler/core.ts
|
|
56
56
|
var emptyArray = [];
|
|
@@ -2844,24 +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["
|
|
2848
|
-
SyntaxKind4[SyntaxKind4["
|
|
2849
|
-
SyntaxKind4[SyntaxKind4["
|
|
2850
|
-
SyntaxKind4[SyntaxKind4["
|
|
2851
|
-
SyntaxKind4[SyntaxKind4["
|
|
2852
|
-
SyntaxKind4[SyntaxKind4["
|
|
2853
|
-
SyntaxKind4[SyntaxKind4["
|
|
2854
|
-
SyntaxKind4[SyntaxKind4["
|
|
2855
|
-
SyntaxKind4[SyntaxKind4["
|
|
2856
|
-
SyntaxKind4[SyntaxKind4["
|
|
2857
|
-
SyntaxKind4[SyntaxKind4["
|
|
2858
|
-
SyntaxKind4[SyntaxKind4["
|
|
2859
|
-
SyntaxKind4[SyntaxKind4["
|
|
2860
|
-
SyntaxKind4[SyntaxKind4["
|
|
2861
|
-
SyntaxKind4[SyntaxKind4["
|
|
2862
|
-
SyntaxKind4[SyntaxKind4["
|
|
2863
|
-
SyntaxKind4[SyntaxKind4["
|
|
2864
|
-
SyntaxKind4[SyntaxKind4["
|
|
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";
|
|
2865
2866
|
SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
|
|
2866
2867
|
SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
|
|
2867
2868
|
SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
|
|
@@ -2890,9 +2891,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
|
|
|
2890
2891
|
SyntaxKind4[SyntaxKind4["LastStatement"] = 256 /* DebuggerStatement */] = "LastStatement";
|
|
2891
2892
|
SyntaxKind4[SyntaxKind4["FirstNode"] = 163 /* QualifiedName */] = "FirstNode";
|
|
2892
2893
|
SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 312 /* JSDocTypeExpression */] = "FirstJSDocNode";
|
|
2893
|
-
SyntaxKind4[SyntaxKind4["LastJSDocNode"] =
|
|
2894
|
+
SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocNode";
|
|
2894
2895
|
SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 330 /* JSDocTag */] = "FirstJSDocTagNode";
|
|
2895
|
-
SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] =
|
|
2896
|
+
SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 352 /* JSDocThrowsTag */] = "LastJSDocTagNode";
|
|
2896
2897
|
SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 126 /* AbstractKeyword */] = "FirstContextualKeyword";
|
|
2897
2898
|
SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 162 /* OfKeyword */] = "LastContextualKeyword";
|
|
2898
2899
|
return SyntaxKind4;
|
|
@@ -3198,6 +3199,7 @@ var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => {
|
|
|
3198
3199
|
ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs";
|
|
3199
3200
|
ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16";
|
|
3200
3201
|
ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext";
|
|
3202
|
+
ModuleResolutionKind2[ModuleResolutionKind2["Bundler"] = 100] = "Bundler";
|
|
3201
3203
|
return ModuleResolutionKind2;
|
|
3202
3204
|
})(ModuleResolutionKind || {});
|
|
3203
3205
|
var TransformFlags = /* @__PURE__ */ ((TransformFlags3) => {
|
|
@@ -5909,6 +5911,7 @@ var Diagnostics = {
|
|
|
5909
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."),
|
|
5910
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."),
|
|
5911
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?"),
|
|
5912
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}'."),
|
|
5913
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}'."),
|
|
5914
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}'."),
|
|
@@ -6073,6 +6076,11 @@ var Diagnostics = {
|
|
|
6073
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'."),
|
|
6074
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'."),
|
|
6075
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."),
|
|
6076
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."),
|
|
6077
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."),
|
|
6078
6086
|
Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
|
|
@@ -6128,7 +6136,6 @@ var Diagnostics = {
|
|
|
6128
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."),
|
|
6129
6137
|
Enables_experimental_support_for_ES7_decorators: diag(6065, 3 /* Message */, "Enables_experimental_support_for_ES7_decorators_6065", "Enables experimental support for ES7 decorators."),
|
|
6130
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."),
|
|
6131
|
-
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)."),
|
|
6132
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."),
|
|
6133
6140
|
Successfully_created_a_tsconfig_json_file: diag(6071, 3 /* Message */, "Successfully_created_a_tsconfig_json_file_6071", "Successfully created a tsconfig.json file."),
|
|
6134
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."),
|
|
@@ -6372,6 +6379,11 @@ var Diagnostics = {
|
|
|
6372
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}'."),
|
|
6373
6380
|
Saw_non_matching_condition_0: diag(6405, 3 /* Message */, "Saw_non_matching_condition_0_6405", "Saw non-matching condition '{0}'."),
|
|
6374
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`."),
|
|
6375
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}'"),
|
|
6376
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."),
|
|
6377
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."),
|
|
@@ -9047,8 +9059,8 @@ function getNonAssignedNameOfDeclaration(declaration) {
|
|
|
9047
9059
|
switch (declaration.kind) {
|
|
9048
9060
|
case 79 /* Identifier */:
|
|
9049
9061
|
return declaration;
|
|
9050
|
-
case
|
|
9051
|
-
case
|
|
9062
|
+
case 351 /* JSDocPropertyTag */:
|
|
9063
|
+
case 344 /* JSDocParameterTag */: {
|
|
9052
9064
|
const { name } = declaration;
|
|
9053
9065
|
if (name.kind === 163 /* QualifiedName */) {
|
|
9054
9066
|
return name.right;
|
|
@@ -9072,9 +9084,9 @@ function getNonAssignedNameOfDeclaration(declaration) {
|
|
|
9072
9084
|
return void 0;
|
|
9073
9085
|
}
|
|
9074
9086
|
}
|
|
9075
|
-
case
|
|
9087
|
+
case 349 /* JSDocTypedefTag */:
|
|
9076
9088
|
return getNameOfJSDocTypedef(declaration);
|
|
9077
|
-
case
|
|
9089
|
+
case 343 /* JSDocEnumTag */:
|
|
9078
9090
|
return nameForNamelessJSDocTypedef(declaration);
|
|
9079
9091
|
case 274 /* ExportAssignment */: {
|
|
9080
9092
|
const { expression } = declaration;
|
|
@@ -9166,6 +9178,8 @@ function getJSDocTypeTag(node) {
|
|
|
9166
9178
|
return void 0;
|
|
9167
9179
|
}
|
|
9168
9180
|
function getJSDocTagsWorker(node, noCache) {
|
|
9181
|
+
if (!canHaveJSDoc(node))
|
|
9182
|
+
return emptyArray;
|
|
9169
9183
|
let tags = node.jsDocCache;
|
|
9170
9184
|
if (tags === void 0 || noCache) {
|
|
9171
9185
|
const comments = getJSDocCommentsAndTags(node, noCache);
|
|
@@ -9473,8 +9487,8 @@ function isExpressionKind(kind) {
|
|
|
9473
9487
|
case 227 /* SpreadElement */:
|
|
9474
9488
|
case 231 /* AsExpression */:
|
|
9475
9489
|
case 229 /* OmittedExpression */:
|
|
9476
|
-
case
|
|
9477
|
-
case
|
|
9490
|
+
case 356 /* CommaListExpression */:
|
|
9491
|
+
case 355 /* PartiallyEmittedExpression */:
|
|
9478
9492
|
case 235 /* SatisfiesExpression */:
|
|
9479
9493
|
return true;
|
|
9480
9494
|
default:
|
|
@@ -9498,18 +9512,126 @@ function isNamedImportBindings(node) {
|
|
|
9498
9512
|
const kind = node.kind;
|
|
9499
9513
|
return kind === 272 /* NamedImports */ || kind === 271 /* NamespaceImport */;
|
|
9500
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
|
+
}
|
|
9501
9623
|
function isDeclarationKind(kind) {
|
|
9502
|
-
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 ===
|
|
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 */;
|
|
9503
9625
|
}
|
|
9504
9626
|
function isDeclarationStatementKind(kind) {
|
|
9505
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 */;
|
|
9506
9628
|
}
|
|
9507
9629
|
function isStatementKindButNotDeclarationKind(kind) {
|
|
9508
|
-
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 ===
|
|
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 */;
|
|
9509
9631
|
}
|
|
9510
9632
|
function isDeclaration(node) {
|
|
9511
9633
|
if (node.kind === 165 /* TypeParameter */) {
|
|
9512
|
-
return node.parent && node.parent.kind !==
|
|
9634
|
+
return node.parent && node.parent.kind !== 348 /* JSDocTemplateTag */ || isInJSFile(node);
|
|
9513
9635
|
}
|
|
9514
9636
|
return isDeclarationKind(node.kind);
|
|
9515
9637
|
}
|
|
@@ -9562,9 +9684,11 @@ function isCaseOrDefaultClause(node) {
|
|
|
9562
9684
|
return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */;
|
|
9563
9685
|
}
|
|
9564
9686
|
function isJSDocNode(node) {
|
|
9565
|
-
return node.kind >= 312 /* FirstJSDocNode */ && node.kind <=
|
|
9687
|
+
return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 352 /* LastJSDocNode */;
|
|
9566
9688
|
}
|
|
9567
9689
|
function hasJSDocNodes(node) {
|
|
9690
|
+
if (!canHaveJSDoc(node))
|
|
9691
|
+
return false;
|
|
9568
9692
|
const { jsDoc } = node;
|
|
9569
9693
|
return !!jsDoc && jsDoc.length > 0;
|
|
9570
9694
|
}
|
|
@@ -9614,11 +9738,7 @@ function createSingleLineStringWriter() {
|
|
|
9614
9738
|
writeLine: () => str += " ",
|
|
9615
9739
|
increaseIndent: noop,
|
|
9616
9740
|
decreaseIndent: noop,
|
|
9617
|
-
clear: () => str = ""
|
|
9618
|
-
trackSymbol: () => false,
|
|
9619
|
-
reportInaccessibleThisError: noop,
|
|
9620
|
-
reportInaccessibleUniqueSymbolError: noop,
|
|
9621
|
-
reportPrivateInBaseOfClassExpression: noop
|
|
9741
|
+
clear: () => str = ""
|
|
9622
9742
|
};
|
|
9623
9743
|
}
|
|
9624
9744
|
function copyEntries(source, target) {
|
|
@@ -9690,7 +9810,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
9690
9810
|
if (includeJsDoc && hasJSDocNodes(node)) {
|
|
9691
9811
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
9692
9812
|
}
|
|
9693
|
-
if (node.kind ===
|
|
9813
|
+
if (node.kind === 353 /* SyntaxList */ && node._children.length > 0) {
|
|
9694
9814
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
9695
9815
|
}
|
|
9696
9816
|
return skipTrivia(
|
|
@@ -9941,7 +10061,7 @@ function isObjectLiteralOrClassExpressionMethodOrAccessor(node) {
|
|
|
9941
10061
|
function getContainingClass(node) {
|
|
9942
10062
|
return findAncestor(node.parent, isClassLike);
|
|
9943
10063
|
}
|
|
9944
|
-
function getThisContainer(node, includeArrowFunctions) {
|
|
10064
|
+
function getThisContainer(node, includeArrowFunctions, includeClassComputedPropertyName) {
|
|
9945
10065
|
Debug.assert(node.kind !== 308 /* SourceFile */);
|
|
9946
10066
|
while (true) {
|
|
9947
10067
|
node = node.parent;
|
|
@@ -9950,10 +10070,10 @@ function getThisContainer(node, includeArrowFunctions) {
|
|
|
9950
10070
|
}
|
|
9951
10071
|
switch (node.kind) {
|
|
9952
10072
|
case 164 /* ComputedPropertyName */:
|
|
9953
|
-
if (isClassLike(node.parent.parent)) {
|
|
10073
|
+
if (includeClassComputedPropertyName && isClassLike(node.parent.parent)) {
|
|
9954
10074
|
return node;
|
|
9955
10075
|
}
|
|
9956
|
-
node = node.parent;
|
|
10076
|
+
node = node.parent.parent;
|
|
9957
10077
|
break;
|
|
9958
10078
|
case 167 /* Decorator */:
|
|
9959
10079
|
if (node.parent.kind === 166 /* Parameter */ && isClassElement(node.parent.parent)) {
|
|
@@ -9990,7 +10110,7 @@ function isInTopLevelContext(node) {
|
|
|
9990
10110
|
if (isIdentifier(node) && (isClassDeclaration(node.parent) || isFunctionDeclaration(node.parent)) && node.parent.name === node) {
|
|
9991
10111
|
node = node.parent;
|
|
9992
10112
|
}
|
|
9993
|
-
const container = getThisContainer(node, true);
|
|
10113
|
+
const container = getThisContainer(node, true, false);
|
|
9994
10114
|
return isSourceFile(container);
|
|
9995
10115
|
}
|
|
9996
10116
|
function getImmediatelyInvokedFunctionExpression(func) {
|
|
@@ -10238,7 +10358,7 @@ function isJSDocConstructSignature(node) {
|
|
|
10238
10358
|
return !!name && name.escapedText === "new";
|
|
10239
10359
|
}
|
|
10240
10360
|
function isJSDocTypeAlias(node) {
|
|
10241
|
-
return node.kind ===
|
|
10361
|
+
return node.kind === 349 /* JSDocTypedefTag */ || node.kind === 341 /* JSDocCallbackTag */ || node.kind === 343 /* JSDocEnumTag */;
|
|
10242
10362
|
}
|
|
10243
10363
|
function getSourceOfAssignment(node) {
|
|
10244
10364
|
return isExpressionStatement(node) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 63 /* EqualsToken */ ? getRightMostAssignedExpression(node.expression) : void 0;
|
|
@@ -10263,6 +10383,78 @@ function getSingleVariableOfVariableStatement(node) {
|
|
|
10263
10383
|
function getNestedModuleDeclaration(node) {
|
|
10264
10384
|
return isModuleDeclaration(node) && node.body && node.body.kind === 264 /* ModuleDeclaration */ ? node.body : void 0;
|
|
10265
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
|
+
}
|
|
10266
10458
|
function getJSDocCommentsAndTags(hostNode, noCache) {
|
|
10267
10459
|
let result;
|
|
10268
10460
|
if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
|
|
@@ -10548,7 +10740,7 @@ function getOperator(expression) {
|
|
|
10548
10740
|
}
|
|
10549
10741
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
10550
10742
|
switch (nodeKind) {
|
|
10551
|
-
case
|
|
10743
|
+
case 356 /* CommaListExpression */:
|
|
10552
10744
|
return 0 /* Comma */;
|
|
10553
10745
|
case 227 /* SpreadElement */:
|
|
10554
10746
|
return 1 /* Spread */;
|
|
@@ -10953,7 +11145,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
10953
11145
|
case 209 /* ElementAccessExpression */:
|
|
10954
11146
|
case 208 /* PropertyAccessExpression */:
|
|
10955
11147
|
case 232 /* NonNullExpression */:
|
|
10956
|
-
case
|
|
11148
|
+
case 355 /* PartiallyEmittedExpression */:
|
|
10957
11149
|
case 235 /* SatisfiesExpression */:
|
|
10958
11150
|
node = node.expression;
|
|
10959
11151
|
continue;
|
|
@@ -10992,6 +11184,7 @@ function Node4(kind, pos, end) {
|
|
|
10992
11184
|
this.transformFlags = 0 /* None */;
|
|
10993
11185
|
this.parent = void 0;
|
|
10994
11186
|
this.original = void 0;
|
|
11187
|
+
this.emitNode = void 0;
|
|
10995
11188
|
}
|
|
10996
11189
|
function Token(kind, pos, end) {
|
|
10997
11190
|
this.pos = pos;
|
|
@@ -11001,6 +11194,7 @@ function Token(kind, pos, end) {
|
|
|
11001
11194
|
this.flags = 0 /* None */;
|
|
11002
11195
|
this.transformFlags = 0 /* None */;
|
|
11003
11196
|
this.parent = void 0;
|
|
11197
|
+
this.emitNode = void 0;
|
|
11004
11198
|
}
|
|
11005
11199
|
function Identifier2(kind, pos, end) {
|
|
11006
11200
|
this.pos = pos;
|
|
@@ -11011,6 +11205,7 @@ function Identifier2(kind, pos, end) {
|
|
|
11011
11205
|
this.transformFlags = 0 /* None */;
|
|
11012
11206
|
this.parent = void 0;
|
|
11013
11207
|
this.original = void 0;
|
|
11208
|
+
this.emitNode = void 0;
|
|
11014
11209
|
this.flowNode = void 0;
|
|
11015
11210
|
}
|
|
11016
11211
|
function SourceMapSource(fileName, text, skipTrivia2) {
|
|
@@ -11168,6 +11363,12 @@ function unreachableCodeIsError(options) {
|
|
|
11168
11363
|
function unusedLabelIsError(options) {
|
|
11169
11364
|
return options.allowUnusedLabels === false;
|
|
11170
11365
|
}
|
|
11366
|
+
function getResolveJsonModule(compilerOptions) {
|
|
11367
|
+
if (compilerOptions.resolveJsonModule !== void 0) {
|
|
11368
|
+
return compilerOptions.resolveJsonModule;
|
|
11369
|
+
}
|
|
11370
|
+
return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
|
|
11371
|
+
}
|
|
11171
11372
|
function shouldPreserveConstEnums(compilerOptions) {
|
|
11172
11373
|
return !!(compilerOptions.preserveConstEnums || compilerOptions.isolatedModules);
|
|
11173
11374
|
}
|
|
@@ -12421,6 +12622,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12421
12622
|
updateJSDocPropertyTag,
|
|
12422
12623
|
createJSDocCallbackTag,
|
|
12423
12624
|
updateJSDocCallbackTag,
|
|
12625
|
+
createJSDocOverloadTag,
|
|
12626
|
+
updateJSDocOverloadTag,
|
|
12424
12627
|
createJSDocAugmentsTag,
|
|
12425
12628
|
updateJSDocAugmentsTag,
|
|
12426
12629
|
createJSDocImplementsTag,
|
|
@@ -12438,28 +12641,22 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12438
12641
|
createJSDocLinkPlain,
|
|
12439
12642
|
updateJSDocLinkPlain,
|
|
12440
12643
|
get createJSDocTypeTag() {
|
|
12441
|
-
return getJSDocTypeLikeTagCreateFunction(
|
|
12644
|
+
return getJSDocTypeLikeTagCreateFunction(347 /* JSDocTypeTag */);
|
|
12442
12645
|
},
|
|
12443
12646
|
get updateJSDocTypeTag() {
|
|
12444
|
-
return getJSDocTypeLikeTagUpdateFunction(
|
|
12647
|
+
return getJSDocTypeLikeTagUpdateFunction(347 /* JSDocTypeTag */);
|
|
12445
12648
|
},
|
|
12446
12649
|
get createJSDocReturnTag() {
|
|
12447
|
-
return getJSDocTypeLikeTagCreateFunction(
|
|
12650
|
+
return getJSDocTypeLikeTagCreateFunction(345 /* JSDocReturnTag */);
|
|
12448
12651
|
},
|
|
12449
12652
|
get updateJSDocReturnTag() {
|
|
12450
|
-
return getJSDocTypeLikeTagUpdateFunction(
|
|
12653
|
+
return getJSDocTypeLikeTagUpdateFunction(345 /* JSDocReturnTag */);
|
|
12451
12654
|
},
|
|
12452
12655
|
get createJSDocThisTag() {
|
|
12453
|
-
return getJSDocTypeLikeTagCreateFunction(
|
|
12656
|
+
return getJSDocTypeLikeTagCreateFunction(346 /* JSDocThisTag */);
|
|
12454
12657
|
},
|
|
12455
12658
|
get updateJSDocThisTag() {
|
|
12456
|
-
return getJSDocTypeLikeTagUpdateFunction(
|
|
12457
|
-
},
|
|
12458
|
-
get createJSDocEnumTag() {
|
|
12459
|
-
return getJSDocTypeLikeTagCreateFunction(342 /* JSDocEnumTag */);
|
|
12460
|
-
},
|
|
12461
|
-
get updateJSDocEnumTag() {
|
|
12462
|
-
return getJSDocTypeLikeTagUpdateFunction(342 /* JSDocEnumTag */);
|
|
12659
|
+
return getJSDocTypeLikeTagUpdateFunction(346 /* JSDocThisTag */);
|
|
12463
12660
|
},
|
|
12464
12661
|
get createJSDocAuthorTag() {
|
|
12465
12662
|
return getJSDocSimpleTagCreateFunction(333 /* JSDocAuthorTag */);
|
|
@@ -12510,11 +12707,13 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12510
12707
|
return getJSDocSimpleTagUpdateFunction(334 /* JSDocDeprecatedTag */);
|
|
12511
12708
|
},
|
|
12512
12709
|
get createJSDocThrowsTag() {
|
|
12513
|
-
return getJSDocTypeLikeTagCreateFunction(
|
|
12710
|
+
return getJSDocTypeLikeTagCreateFunction(352 /* JSDocThrowsTag */);
|
|
12514
12711
|
},
|
|
12515
12712
|
get updateJSDocThrowsTag() {
|
|
12516
|
-
return getJSDocTypeLikeTagUpdateFunction(
|
|
12713
|
+
return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */);
|
|
12517
12714
|
},
|
|
12715
|
+
createJSDocEnumTag,
|
|
12716
|
+
updateJSDocEnumTag,
|
|
12518
12717
|
createJSDocUnknownTag,
|
|
12519
12718
|
updateJSDocUnknownTag,
|
|
12520
12719
|
createJSDocText,
|
|
@@ -12561,6 +12760,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12561
12760
|
updateEnumMember,
|
|
12562
12761
|
createSourceFile: createSourceFile2,
|
|
12563
12762
|
updateSourceFile,
|
|
12763
|
+
createRedirectedSourceFile,
|
|
12564
12764
|
createBundle,
|
|
12565
12765
|
updateBundle,
|
|
12566
12766
|
createUnparsedSource,
|
|
@@ -12737,8 +12937,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12737
12937
|
}
|
|
12738
12938
|
const length2 = elements.length;
|
|
12739
12939
|
const array = length2 >= 1 && length2 <= 4 ? elements.slice() : elements;
|
|
12740
|
-
|
|
12940
|
+
array.pos = -1;
|
|
12941
|
+
array.end = -1;
|
|
12741
12942
|
array.hasTrailingComma = !!hasTrailingComma;
|
|
12943
|
+
array.transformFlags = 0 /* None */;
|
|
12742
12944
|
aggregateChildrenFlags(array);
|
|
12743
12945
|
Debug.attachNodeArrayDebugInfo(array);
|
|
12744
12946
|
return array;
|
|
@@ -12750,61 +12952,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12750
12952
|
const node = createBaseNode(kind);
|
|
12751
12953
|
node.symbol = void 0;
|
|
12752
12954
|
node.localSymbol = void 0;
|
|
12753
|
-
node.locals = void 0;
|
|
12754
|
-
node.nextContainer = void 0;
|
|
12755
|
-
return node;
|
|
12756
|
-
}
|
|
12757
|
-
function createBaseNamedDeclaration(kind, modifiers, name) {
|
|
12758
|
-
const node = createBaseDeclaration(kind);
|
|
12759
|
-
name = asName(name);
|
|
12760
|
-
node.name = name;
|
|
12761
|
-
if (canHaveModifiers(node)) {
|
|
12762
|
-
node.modifiers = asNodeArray(modifiers);
|
|
12763
|
-
node.transformFlags |= propagateChildrenFlags(node.modifiers);
|
|
12764
|
-
}
|
|
12765
|
-
if (name) {
|
|
12766
|
-
switch (node.kind) {
|
|
12767
|
-
case 171 /* MethodDeclaration */:
|
|
12768
|
-
case 174 /* GetAccessor */:
|
|
12769
|
-
case 175 /* SetAccessor */:
|
|
12770
|
-
case 169 /* PropertyDeclaration */:
|
|
12771
|
-
case 299 /* PropertyAssignment */:
|
|
12772
|
-
if (isIdentifier(name)) {
|
|
12773
|
-
node.transformFlags |= propagateIdentifierNameFlags(name);
|
|
12774
|
-
break;
|
|
12775
|
-
}
|
|
12776
|
-
default:
|
|
12777
|
-
node.transformFlags |= propagateChildFlags(name);
|
|
12778
|
-
break;
|
|
12779
|
-
}
|
|
12780
|
-
}
|
|
12781
|
-
return node;
|
|
12782
|
-
}
|
|
12783
|
-
function createBaseGenericNamedDeclaration(kind, modifiers, name, typeParameters) {
|
|
12784
|
-
const node = createBaseNamedDeclaration(
|
|
12785
|
-
kind,
|
|
12786
|
-
modifiers,
|
|
12787
|
-
name
|
|
12788
|
-
);
|
|
12789
|
-
node.typeParameters = asNodeArray(typeParameters);
|
|
12790
|
-
node.transformFlags |= propagateChildrenFlags(node.typeParameters);
|
|
12791
|
-
if (typeParameters)
|
|
12792
|
-
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
12793
|
-
return node;
|
|
12794
|
-
}
|
|
12795
|
-
function createBaseSignatureDeclaration(kind, modifiers, name, typeParameters, parameters, type) {
|
|
12796
|
-
const node = createBaseGenericNamedDeclaration(
|
|
12797
|
-
kind,
|
|
12798
|
-
modifiers,
|
|
12799
|
-
name,
|
|
12800
|
-
typeParameters
|
|
12801
|
-
);
|
|
12802
|
-
node.parameters = createNodeArray(parameters);
|
|
12803
|
-
node.type = type;
|
|
12804
|
-
node.transformFlags |= propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type);
|
|
12805
|
-
if (type)
|
|
12806
|
-
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
12807
|
-
node.typeArguments = void 0;
|
|
12808
12955
|
return node;
|
|
12809
12956
|
}
|
|
12810
12957
|
function finishUpdateBaseSignatureDeclaration(updated, original) {
|
|
@@ -12813,86 +12960,23 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12813
12960
|
}
|
|
12814
12961
|
return update(updated, original);
|
|
12815
12962
|
}
|
|
12816
|
-
function createBaseFunctionLikeDeclaration(kind, modifiers, name, typeParameters, parameters, type, body) {
|
|
12817
|
-
const node = createBaseSignatureDeclaration(
|
|
12818
|
-
kind,
|
|
12819
|
-
modifiers,
|
|
12820
|
-
name,
|
|
12821
|
-
typeParameters,
|
|
12822
|
-
parameters,
|
|
12823
|
-
type
|
|
12824
|
-
);
|
|
12825
|
-
node.body = body;
|
|
12826
|
-
node.transformFlags |= propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
12827
|
-
if (!body)
|
|
12828
|
-
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
12829
|
-
return node;
|
|
12830
|
-
}
|
|
12831
|
-
function createBaseInterfaceOrClassLikeDeclaration(kind, modifiers, name, typeParameters, heritageClauses) {
|
|
12832
|
-
const node = createBaseGenericNamedDeclaration(
|
|
12833
|
-
kind,
|
|
12834
|
-
modifiers,
|
|
12835
|
-
name,
|
|
12836
|
-
typeParameters
|
|
12837
|
-
);
|
|
12838
|
-
node.heritageClauses = asNodeArray(heritageClauses);
|
|
12839
|
-
node.transformFlags |= propagateChildrenFlags(node.heritageClauses);
|
|
12840
|
-
return node;
|
|
12841
|
-
}
|
|
12842
|
-
function createBaseClassLikeDeclaration(kind, modifiers, name, typeParameters, heritageClauses, members) {
|
|
12843
|
-
const node = createBaseInterfaceOrClassLikeDeclaration(
|
|
12844
|
-
kind,
|
|
12845
|
-
modifiers,
|
|
12846
|
-
name,
|
|
12847
|
-
typeParameters,
|
|
12848
|
-
heritageClauses
|
|
12849
|
-
);
|
|
12850
|
-
node.members = createNodeArray(members);
|
|
12851
|
-
node.transformFlags |= propagateChildrenFlags(node.members);
|
|
12852
|
-
return node;
|
|
12853
|
-
}
|
|
12854
|
-
function createBaseBindingLikeDeclaration(kind, modifiers, name, initializer) {
|
|
12855
|
-
const node = createBaseNamedDeclaration(
|
|
12856
|
-
kind,
|
|
12857
|
-
modifiers,
|
|
12858
|
-
name
|
|
12859
|
-
);
|
|
12860
|
-
node.initializer = initializer;
|
|
12861
|
-
node.transformFlags |= propagateChildFlags(node.initializer);
|
|
12862
|
-
return node;
|
|
12863
|
-
}
|
|
12864
|
-
function createBaseVariableLikeDeclaration(kind, modifiers, name, type, initializer) {
|
|
12865
|
-
const node = createBaseBindingLikeDeclaration(
|
|
12866
|
-
kind,
|
|
12867
|
-
modifiers,
|
|
12868
|
-
name,
|
|
12869
|
-
initializer
|
|
12870
|
-
);
|
|
12871
|
-
node.type = type;
|
|
12872
|
-
node.transformFlags |= propagateChildFlags(type);
|
|
12873
|
-
if (type)
|
|
12874
|
-
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
12875
|
-
return node;
|
|
12876
|
-
}
|
|
12877
|
-
function createBaseLiteral(kind, text) {
|
|
12878
|
-
const node = createBaseToken(kind);
|
|
12879
|
-
node.text = text;
|
|
12880
|
-
return node;
|
|
12881
|
-
}
|
|
12882
12963
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
12883
|
-
const node =
|
|
12964
|
+
const node = createBaseDeclaration(8 /* NumericLiteral */);
|
|
12965
|
+
node.text = typeof value === "number" ? value + "" : value;
|
|
12884
12966
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
12885
12967
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
12886
12968
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
12887
12969
|
return node;
|
|
12888
12970
|
}
|
|
12889
12971
|
function createBigIntLiteral(value) {
|
|
12890
|
-
const node =
|
|
12972
|
+
const node = createBaseToken(9 /* BigIntLiteral */);
|
|
12973
|
+
node.text = typeof value === "string" ? value : pseudoBigIntToString(value) + "n";
|
|
12891
12974
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
12892
12975
|
return node;
|
|
12893
12976
|
}
|
|
12894
12977
|
function createBaseStringLiteral(text, isSingleQuote) {
|
|
12895
|
-
const node =
|
|
12978
|
+
const node = createBaseDeclaration(10 /* StringLiteral */);
|
|
12979
|
+
node.text = text;
|
|
12896
12980
|
node.singleQuote = isSingleQuote;
|
|
12897
12981
|
return node;
|
|
12898
12982
|
}
|
|
@@ -12909,7 +12993,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12909
12993
|
return node;
|
|
12910
12994
|
}
|
|
12911
12995
|
function createRegularExpressionLiteral(text) {
|
|
12912
|
-
const node =
|
|
12996
|
+
const node = createBaseToken(13 /* RegularExpressionLiteral */);
|
|
12997
|
+
node.text = text;
|
|
12913
12998
|
return node;
|
|
12914
12999
|
}
|
|
12915
13000
|
function createLiteralLikeNode(kind, text) {
|
|
@@ -12930,20 +13015,15 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12930
13015
|
return createTemplateLiteralLikeNode(kind, text, void 0, 0);
|
|
12931
13016
|
}
|
|
12932
13017
|
}
|
|
12933
|
-
function createBaseIdentifier(
|
|
12934
|
-
if (originalKeywordKind === void 0 && text) {
|
|
12935
|
-
originalKeywordKind = stringToToken(text);
|
|
12936
|
-
}
|
|
12937
|
-
if (originalKeywordKind === 79 /* Identifier */) {
|
|
12938
|
-
originalKeywordKind = void 0;
|
|
12939
|
-
}
|
|
13018
|
+
function createBaseIdentifier(escapedText, originalKeywordKind) {
|
|
12940
13019
|
const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
|
|
12941
13020
|
node.originalKeywordKind = originalKeywordKind;
|
|
12942
|
-
node.escapedText =
|
|
13021
|
+
node.escapedText = escapedText;
|
|
13022
|
+
node.autoGenerateFlags = 0 /* None */;
|
|
12943
13023
|
return node;
|
|
12944
13024
|
}
|
|
12945
13025
|
function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
12946
|
-
const node = createBaseIdentifier(text, void 0);
|
|
13026
|
+
const node = createBaseIdentifier(escapeLeadingUnderscores(text), void 0);
|
|
12947
13027
|
node.autoGenerateFlags = autoGenerateFlags;
|
|
12948
13028
|
node.autoGenerateId = nextAutoGenerateId;
|
|
12949
13029
|
node.autoGeneratePrefix = prefix;
|
|
@@ -12952,15 +13032,23 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12952
13032
|
return node;
|
|
12953
13033
|
}
|
|
12954
13034
|
function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
13035
|
+
if (originalKeywordKind === void 0 && text) {
|
|
13036
|
+
originalKeywordKind = stringToToken(text);
|
|
13037
|
+
}
|
|
13038
|
+
if (originalKeywordKind === 79 /* Identifier */) {
|
|
13039
|
+
originalKeywordKind = void 0;
|
|
12958
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;
|
|
12959
13048
|
if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
|
|
12960
13049
|
node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
|
|
12961
13050
|
}
|
|
12962
|
-
if (hasExtendedUnicodeEscape) {
|
|
12963
|
-
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
13051
|
+
if (node.hasExtendedUnicodeEscape) {
|
|
12964
13052
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
12965
13053
|
}
|
|
12966
13054
|
return node;
|
|
@@ -12998,19 +13086,20 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
12998
13086
|
name.original = node;
|
|
12999
13087
|
return name;
|
|
13000
13088
|
}
|
|
13001
|
-
function createBasePrivateIdentifier(
|
|
13089
|
+
function createBasePrivateIdentifier(escapedText) {
|
|
13002
13090
|
const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
|
|
13003
|
-
node.escapedText =
|
|
13091
|
+
node.escapedText = escapedText;
|
|
13092
|
+
node.autoGenerateFlags = 0 /* None */;
|
|
13004
13093
|
node.transformFlags |= 16777216 /* ContainsClassFields */;
|
|
13005
13094
|
return node;
|
|
13006
13095
|
}
|
|
13007
13096
|
function createPrivateIdentifier(text) {
|
|
13008
13097
|
if (!startsWith(text, "#"))
|
|
13009
13098
|
Debug.fail("First character of private identifier must be #: " + text);
|
|
13010
|
-
return createBasePrivateIdentifier(text);
|
|
13099
|
+
return createBasePrivateIdentifier(escapeLeadingUnderscores(text));
|
|
13011
13100
|
}
|
|
13012
13101
|
function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
13013
|
-
const node = createBasePrivateIdentifier(text);
|
|
13102
|
+
const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
|
|
13014
13103
|
node.autoGenerateFlags = autoGenerateFlags;
|
|
13015
13104
|
node.autoGenerateId = nextAutoGenerateId;
|
|
13016
13105
|
node.autoGeneratePrefix = prefix;
|
|
@@ -13070,6 +13159,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13070
13159
|
break;
|
|
13071
13160
|
case 106 /* SuperKeyword */:
|
|
13072
13161
|
transformFlags = 1024 /* ContainsES2015 */ | 134217728 /* ContainsLexicalSuper */;
|
|
13162
|
+
node.flowNode = void 0;
|
|
13073
13163
|
break;
|
|
13074
13164
|
case 124 /* StaticKeyword */:
|
|
13075
13165
|
transformFlags = 1024 /* ContainsES2015 */;
|
|
@@ -13079,6 +13169,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13079
13169
|
break;
|
|
13080
13170
|
case 108 /* ThisKeyword */:
|
|
13081
13171
|
transformFlags = 16384 /* ContainsLexicalThis */;
|
|
13172
|
+
node.flowNode = void 0;
|
|
13082
13173
|
break;
|
|
13083
13174
|
}
|
|
13084
13175
|
if (transformFlags) {
|
|
@@ -13143,6 +13234,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13143
13234
|
node.left = left;
|
|
13144
13235
|
node.right = asName(right);
|
|
13145
13236
|
node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right);
|
|
13237
|
+
node.flowNode = void 0;
|
|
13146
13238
|
return node;
|
|
13147
13239
|
}
|
|
13148
13240
|
function updateQualifiedName(node, left, right) {
|
|
@@ -13158,40 +13250,36 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13158
13250
|
return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node;
|
|
13159
13251
|
}
|
|
13160
13252
|
function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) {
|
|
13161
|
-
const node =
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
name
|
|
13165
|
-
);
|
|
13253
|
+
const node = createBaseDeclaration(165 /* TypeParameter */);
|
|
13254
|
+
node.modifiers = asNodeArray(modifiers);
|
|
13255
|
+
node.name = asName(name);
|
|
13166
13256
|
node.constraint = constraint;
|
|
13167
13257
|
node.default = defaultType;
|
|
13168
13258
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
13259
|
+
node.expression = void 0;
|
|
13260
|
+
node.jsDoc = void 0;
|
|
13261
|
+
node.jsDocCache = void 0;
|
|
13169
13262
|
return node;
|
|
13170
13263
|
}
|
|
13171
13264
|
function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) {
|
|
13172
13265
|
return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node) : node;
|
|
13173
13266
|
}
|
|
13174
13267
|
function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) {
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
name,
|
|
13179
|
-
type,
|
|
13180
|
-
initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
|
|
13181
|
-
);
|
|
13268
|
+
var _a2, _b;
|
|
13269
|
+
const node = createBaseDeclaration(166 /* Parameter */);
|
|
13270
|
+
node.modifiers = asNodeArray(modifiers);
|
|
13182
13271
|
node.dotDotDotToken = dotDotDotToken;
|
|
13272
|
+
node.name = asName(name);
|
|
13183
13273
|
node.questionToken = questionToken;
|
|
13274
|
+
node.type = type;
|
|
13275
|
+
node.initializer = asInitializer(initializer);
|
|
13184
13276
|
if (isThisIdentifier(node.name)) {
|
|
13185
13277
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
13186
13278
|
} else {
|
|
13187
|
-
node.transformFlags
|
|
13188
|
-
if (questionToken)
|
|
13189
|
-
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
13190
|
-
if (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */)
|
|
13191
|
-
node.transformFlags |= 8192 /* ContainsTypeScriptClassSyntax */;
|
|
13192
|
-
if (initializer || dotDotDotToken)
|
|
13193
|
-
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 */);
|
|
13194
13280
|
}
|
|
13281
|
+
node.jsDoc = void 0;
|
|
13282
|
+
node.jsDocCache = void 0;
|
|
13195
13283
|
return node;
|
|
13196
13284
|
}
|
|
13197
13285
|
function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
|
|
@@ -13207,15 +13295,15 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13207
13295
|
return node.expression !== expression ? update(createDecorator(expression), node) : node;
|
|
13208
13296
|
}
|
|
13209
13297
|
function createPropertySignature(modifiers, name, questionToken, type) {
|
|
13210
|
-
const node =
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
name
|
|
13214
|
-
);
|
|
13298
|
+
const node = createBaseDeclaration(168 /* PropertySignature */);
|
|
13299
|
+
node.modifiers = asNodeArray(modifiers);
|
|
13300
|
+
node.name = asName(name);
|
|
13215
13301
|
node.type = type;
|
|
13216
13302
|
node.questionToken = questionToken;
|
|
13217
13303
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
13218
13304
|
node.initializer = void 0;
|
|
13305
|
+
node.jsDoc = void 0;
|
|
13306
|
+
node.jsDocCache = void 0;
|
|
13219
13307
|
return node;
|
|
13220
13308
|
}
|
|
13221
13309
|
function updatePropertySignature(node, modifiers, name, questionToken, type) {
|
|
@@ -13228,69 +13316,68 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13228
13316
|
return update(updated, original);
|
|
13229
13317
|
}
|
|
13230
13318
|
function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) {
|
|
13231
|
-
const node =
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
name,
|
|
13235
|
-
type,
|
|
13236
|
-
initializer
|
|
13237
|
-
);
|
|
13319
|
+
const node = createBaseDeclaration(169 /* PropertyDeclaration */);
|
|
13320
|
+
node.modifiers = asNodeArray(modifiers);
|
|
13321
|
+
node.name = asName(name);
|
|
13238
13322
|
node.questionToken = questionOrExclamationToken && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0;
|
|
13239
13323
|
node.exclamationToken = questionOrExclamationToken && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0;
|
|
13240
|
-
node.
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
}
|
|
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;
|
|
13247
13330
|
return node;
|
|
13248
13331
|
}
|
|
13249
13332
|
function updatePropertyDeclaration(node, modifiers, name, questionOrExclamationToken, type, initializer) {
|
|
13250
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;
|
|
13251
13334
|
}
|
|
13252
13335
|
function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) {
|
|
13253
|
-
const node =
|
|
13254
|
-
|
|
13255
|
-
|
|
13256
|
-
name,
|
|
13257
|
-
typeParameters,
|
|
13258
|
-
parameters,
|
|
13259
|
-
type
|
|
13260
|
-
);
|
|
13336
|
+
const node = createBaseDeclaration(170 /* MethodSignature */);
|
|
13337
|
+
node.modifiers = asNodeArray(modifiers);
|
|
13338
|
+
node.name = asName(name);
|
|
13261
13339
|
node.questionToken = questionToken;
|
|
13340
|
+
node.typeParameters = asNodeArray(typeParameters);
|
|
13341
|
+
node.parameters = asNodeArray(parameters);
|
|
13342
|
+
node.type = type;
|
|
13262
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;
|
|
13263
13349
|
return node;
|
|
13264
13350
|
}
|
|
13265
13351
|
function updateMethodSignature(node, modifiers, name, questionToken, typeParameters, parameters, type) {
|
|
13266
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;
|
|
13267
13353
|
}
|
|
13268
13354
|
function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
|
|
13269
|
-
const node =
|
|
13270
|
-
|
|
13271
|
-
modifiers,
|
|
13272
|
-
name,
|
|
13273
|
-
typeParameters,
|
|
13274
|
-
parameters,
|
|
13275
|
-
type,
|
|
13276
|
-
body
|
|
13277
|
-
);
|
|
13355
|
+
const node = createBaseDeclaration(171 /* MethodDeclaration */);
|
|
13356
|
+
node.modifiers = asNodeArray(modifiers);
|
|
13278
13357
|
node.asteriskToken = asteriskToken;
|
|
13358
|
+
node.name = asName(name);
|
|
13279
13359
|
node.questionToken = questionToken;
|
|
13280
|
-
node.transformFlags |= propagateChildFlags(node.asteriskToken) | propagateChildFlags(node.questionToken) | 1024 /* ContainsES2015 */;
|
|
13281
|
-
if (questionToken) {
|
|
13282
|
-
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
13283
|
-
}
|
|
13284
|
-
if (modifiersToFlags(node.modifiers) & 512 /* Async */) {
|
|
13285
|
-
if (asteriskToken) {
|
|
13286
|
-
node.transformFlags |= 128 /* ContainsES2018 */;
|
|
13287
|
-
} else {
|
|
13288
|
-
node.transformFlags |= 256 /* ContainsES2017 */;
|
|
13289
|
-
}
|
|
13290
|
-
} else if (asteriskToken) {
|
|
13291
|
-
node.transformFlags |= 2048 /* ContainsGenerator */;
|
|
13292
|
-
}
|
|
13293
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;
|
|
13294
13381
|
return node;
|
|
13295
13382
|
}
|
|
13296
13383
|
function updateMethodDeclaration(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) {
|
|
@@ -13303,16 +13390,17 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13303
13390
|
return update(updated, original);
|
|
13304
13391
|
}
|
|
13305
13392
|
function createClassStaticBlockDeclaration(body) {
|
|
13306
|
-
const node =
|
|
13307
|
-
172 /* ClassStaticBlockDeclaration */,
|
|
13308
|
-
void 0,
|
|
13309
|
-
void 0,
|
|
13310
|
-
void 0
|
|
13311
|
-
);
|
|
13393
|
+
const node = createBaseDeclaration(172 /* ClassStaticBlockDeclaration */);
|
|
13312
13394
|
node.body = body;
|
|
13313
13395
|
node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */;
|
|
13314
13396
|
node.illegalDecorators = void 0;
|
|
13315
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;
|
|
13316
13404
|
return node;
|
|
13317
13405
|
}
|
|
13318
13406
|
function updateClassStaticBlockDeclaration(node, body) {
|
|
@@ -13326,19 +13414,21 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13326
13414
|
return update(updated, original);
|
|
13327
13415
|
}
|
|
13328
13416
|
function createConstructorDeclaration(modifiers, parameters, body) {
|
|
13329
|
-
const node =
|
|
13330
|
-
|
|
13331
|
-
|
|
13332
|
-
|
|
13333
|
-
|
|
13334
|
-
parameters,
|
|
13335
|
-
void 0,
|
|
13336
|
-
body
|
|
13337
|
-
);
|
|
13338
|
-
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 */;
|
|
13339
13422
|
node.illegalDecorators = void 0;
|
|
13340
13423
|
node.typeParameters = void 0;
|
|
13341
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;
|
|
13342
13432
|
return node;
|
|
13343
13433
|
}
|
|
13344
13434
|
function updateConstructorDeclaration(node, modifiers, parameters, body) {
|
|
@@ -13353,16 +13443,26 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13353
13443
|
return finishUpdateBaseSignatureDeclaration(updated, original);
|
|
13354
13444
|
}
|
|
13355
13445
|
function createGetAccessorDeclaration(modifiers, name, parameters, type, body) {
|
|
13356
|
-
const node =
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
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;
|
|
13365
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;
|
|
13366
13466
|
return node;
|
|
13367
13467
|
}
|
|
13368
13468
|
function updateGetAccessorDeclaration(node, modifiers, name, parameters, type, body) {
|
|
@@ -13375,17 +13475,26 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13375
13475
|
return finishUpdateBaseSignatureDeclaration(updated, original);
|
|
13376
13476
|
}
|
|
13377
13477
|
function createSetAccessorDeclaration(modifiers, name, parameters, body) {
|
|
13378
|
-
const node =
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
|
|
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;
|
|
13387
13489
|
node.typeParameters = void 0;
|
|
13388
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;
|
|
13389
13498
|
return node;
|
|
13390
13499
|
}
|
|
13391
13500
|
function updateSetAccessorDeclaration(node, modifiers, name, parameters, body) {
|
|
@@ -13399,45 +13508,49 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13399
13508
|
return finishUpdateBaseSignatureDeclaration(updated, original);
|
|
13400
13509
|
}
|
|
13401
13510
|
function createCallSignature(typeParameters, parameters, type) {
|
|
13402
|
-
const node =
|
|
13403
|
-
|
|
13404
|
-
|
|
13405
|
-
|
|
13406
|
-
typeParameters,
|
|
13407
|
-
parameters,
|
|
13408
|
-
type
|
|
13409
|
-
);
|
|
13511
|
+
const node = createBaseDeclaration(176 /* CallSignature */);
|
|
13512
|
+
node.typeParameters = asNodeArray(typeParameters);
|
|
13513
|
+
node.parameters = asNodeArray(parameters);
|
|
13514
|
+
node.type = type;
|
|
13410
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;
|
|
13411
13521
|
return node;
|
|
13412
13522
|
}
|
|
13413
13523
|
function updateCallSignature(node, typeParameters, parameters, type) {
|
|
13414
13524
|
return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node) : node;
|
|
13415
13525
|
}
|
|
13416
13526
|
function createConstructSignature(typeParameters, parameters, type) {
|
|
13417
|
-
const node =
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13421
|
-
typeParameters,
|
|
13422
|
-
parameters,
|
|
13423
|
-
type
|
|
13424
|
-
);
|
|
13527
|
+
const node = createBaseDeclaration(177 /* ConstructSignature */);
|
|
13528
|
+
node.typeParameters = asNodeArray(typeParameters);
|
|
13529
|
+
node.parameters = asNodeArray(parameters);
|
|
13530
|
+
node.type = type;
|
|
13425
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;
|
|
13426
13537
|
return node;
|
|
13427
13538
|
}
|
|
13428
13539
|
function updateConstructSignature(node, typeParameters, parameters, type) {
|
|
13429
13540
|
return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node) : node;
|
|
13430
13541
|
}
|
|
13431
13542
|
function createIndexSignature(modifiers, parameters, type) {
|
|
13432
|
-
const node =
|
|
13433
|
-
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
void 0,
|
|
13437
|
-
parameters,
|
|
13438
|
-
type
|
|
13439
|
-
);
|
|
13543
|
+
const node = createBaseDeclaration(178 /* IndexSignature */);
|
|
13544
|
+
node.modifiers = asNodeArray(modifiers);
|
|
13545
|
+
node.parameters = asNodeArray(parameters);
|
|
13546
|
+
node.type = type;
|
|
13440
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;
|
|
13441
13554
|
return node;
|
|
13442
13555
|
}
|
|
13443
13556
|
function updateIndexSignature(node, modifiers, parameters, type) {
|
|
@@ -13478,16 +13591,17 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13478
13591
|
return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node;
|
|
13479
13592
|
}
|
|
13480
13593
|
function createFunctionTypeNode(typeParameters, parameters, type) {
|
|
13481
|
-
const node =
|
|
13482
|
-
|
|
13483
|
-
|
|
13484
|
-
|
|
13485
|
-
typeParameters,
|
|
13486
|
-
parameters,
|
|
13487
|
-
type
|
|
13488
|
-
);
|
|
13594
|
+
const node = createBaseDeclaration(181 /* FunctionType */);
|
|
13595
|
+
node.typeParameters = asNodeArray(typeParameters);
|
|
13596
|
+
node.parameters = asNodeArray(parameters);
|
|
13597
|
+
node.type = type;
|
|
13489
13598
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
13490
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;
|
|
13491
13605
|
return node;
|
|
13492
13606
|
}
|
|
13493
13607
|
function updateFunctionTypeNode(node, typeParameters, parameters, type) {
|
|
@@ -13503,15 +13617,17 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13503
13617
|
return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified.");
|
|
13504
13618
|
}
|
|
13505
13619
|
function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) {
|
|
13506
|
-
const node =
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13510
|
-
|
|
13511
|
-
parameters,
|
|
13512
|
-
type
|
|
13513
|
-
);
|
|
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;
|
|
13514
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;
|
|
13515
13631
|
return node;
|
|
13516
13632
|
}
|
|
13517
13633
|
function createConstructorTypeNode2(typeParameters, parameters, type) {
|
|
@@ -13537,7 +13653,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13537
13653
|
return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node;
|
|
13538
13654
|
}
|
|
13539
13655
|
function createTypeLiteralNode(members) {
|
|
13540
|
-
const node =
|
|
13656
|
+
const node = createBaseDeclaration(184 /* TypeLiteral */);
|
|
13541
13657
|
node.members = createNodeArray(members);
|
|
13542
13658
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
13543
13659
|
return node;
|
|
@@ -13564,12 +13680,14 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13564
13680
|
return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node;
|
|
13565
13681
|
}
|
|
13566
13682
|
function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {
|
|
13567
|
-
const node =
|
|
13683
|
+
const node = createBaseDeclaration(199 /* NamedTupleMember */);
|
|
13568
13684
|
node.dotDotDotToken = dotDotDotToken;
|
|
13569
13685
|
node.name = name;
|
|
13570
13686
|
node.questionToken = questionToken;
|
|
13571
13687
|
node.type = type;
|
|
13572
13688
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
13689
|
+
node.jsDoc = void 0;
|
|
13690
|
+
node.jsDocCache = void 0;
|
|
13573
13691
|
return node;
|
|
13574
13692
|
}
|
|
13575
13693
|
function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) {
|
|
@@ -13621,6 +13739,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13621
13739
|
node.trueType = trueType;
|
|
13622
13740
|
node.falseType = falseType;
|
|
13623
13741
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
13742
|
+
node.locals = void 0;
|
|
13743
|
+
node.nextContainer = void 0;
|
|
13624
13744
|
return node;
|
|
13625
13745
|
}
|
|
13626
13746
|
function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) {
|
|
@@ -13693,7 +13813,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13693
13813
|
return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node;
|
|
13694
13814
|
}
|
|
13695
13815
|
function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) {
|
|
13696
|
-
const node =
|
|
13816
|
+
const node = createBaseDeclaration(197 /* MappedType */);
|
|
13697
13817
|
node.readonlyToken = readonlyToken;
|
|
13698
13818
|
node.typeParameter = typeParameter;
|
|
13699
13819
|
node.nameType = nameType;
|
|
@@ -13701,6 +13821,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13701
13821
|
node.type = type;
|
|
13702
13822
|
node.members = members && createNodeArray(members);
|
|
13703
13823
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
13824
|
+
node.locals = void 0;
|
|
13825
|
+
node.nextContainer = void 0;
|
|
13704
13826
|
return node;
|
|
13705
13827
|
}
|
|
13706
13828
|
function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type, members) {
|
|
@@ -13737,31 +13859,20 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13737
13859
|
return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node;
|
|
13738
13860
|
}
|
|
13739
13861
|
function createBindingElement(dotDotDotToken, propertyName, name, initializer) {
|
|
13740
|
-
const node =
|
|
13741
|
-
205 /* BindingElement */,
|
|
13742
|
-
void 0,
|
|
13743
|
-
name,
|
|
13744
|
-
initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
|
|
13745
|
-
);
|
|
13746
|
-
node.propertyName = asName(propertyName);
|
|
13862
|
+
const node = createBaseDeclaration(205 /* BindingElement */);
|
|
13747
13863
|
node.dotDotDotToken = dotDotDotToken;
|
|
13748
|
-
node.
|
|
13749
|
-
|
|
13750
|
-
|
|
13751
|
-
|
|
13752
|
-
|
|
13753
|
-
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;
|
|
13754
13869
|
return node;
|
|
13755
13870
|
}
|
|
13756
13871
|
function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) {
|
|
13757
13872
|
return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) : node;
|
|
13758
13873
|
}
|
|
13759
|
-
function createBaseExpression(kind) {
|
|
13760
|
-
const node = createBaseNode(kind);
|
|
13761
|
-
return node;
|
|
13762
|
-
}
|
|
13763
13874
|
function createArrayLiteralExpression(elements, multiLine) {
|
|
13764
|
-
const node =
|
|
13875
|
+
const node = createBaseNode(206 /* ArrayLiteralExpression */);
|
|
13765
13876
|
const lastElement = elements && lastOrUndefined(elements);
|
|
13766
13877
|
const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0);
|
|
13767
13878
|
node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray);
|
|
@@ -13773,20 +13884,34 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13773
13884
|
return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node;
|
|
13774
13885
|
}
|
|
13775
13886
|
function createObjectLiteralExpression(properties, multiLine) {
|
|
13776
|
-
const node =
|
|
13887
|
+
const node = createBaseDeclaration(207 /* ObjectLiteralExpression */);
|
|
13777
13888
|
node.properties = createNodeArray(properties);
|
|
13778
13889
|
node.multiLine = multiLine;
|
|
13779
13890
|
node.transformFlags |= propagateChildrenFlags(node.properties);
|
|
13891
|
+
node.jsDoc = void 0;
|
|
13892
|
+
node.jsDocCache = void 0;
|
|
13780
13893
|
return node;
|
|
13781
13894
|
}
|
|
13782
13895
|
function updateObjectLiteralExpression(node, properties) {
|
|
13783
13896
|
return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node;
|
|
13784
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
|
+
}
|
|
13785
13909
|
function createPropertyAccessExpression(expression, name) {
|
|
13786
|
-
const node =
|
|
13787
|
-
|
|
13788
|
-
|
|
13789
|
-
|
|
13910
|
+
const node = createBasePropertyAccessExpression(
|
|
13911
|
+
parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false),
|
|
13912
|
+
void 0,
|
|
13913
|
+
asName(name)
|
|
13914
|
+
);
|
|
13790
13915
|
if (isSuperKeyword(expression)) {
|
|
13791
13916
|
node.transformFlags |= 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */;
|
|
13792
13917
|
}
|
|
@@ -13799,23 +13924,36 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13799
13924
|
return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node;
|
|
13800
13925
|
}
|
|
13801
13926
|
function createPropertyAccessChain(expression, questionDotToken, name) {
|
|
13802
|
-
const node =
|
|
13927
|
+
const node = createBasePropertyAccessExpression(
|
|
13928
|
+
parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true),
|
|
13929
|
+
questionDotToken,
|
|
13930
|
+
asName(name)
|
|
13931
|
+
);
|
|
13803
13932
|
node.flags |= 32 /* OptionalChain */;
|
|
13804
|
-
node.
|
|
13805
|
-
node.questionDotToken = questionDotToken;
|
|
13806
|
-
node.name = asName(name);
|
|
13807
|
-
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 */;
|
|
13808
13934
|
return node;
|
|
13809
13935
|
}
|
|
13810
13936
|
function updatePropertyAccessChain(node, expression, questionDotToken, name) {
|
|
13811
13937
|
Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead.");
|
|
13812
13938
|
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node;
|
|
13813
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
|
+
}
|
|
13814
13951
|
function createElementAccessExpression(expression, index) {
|
|
13815
|
-
const node =
|
|
13816
|
-
|
|
13817
|
-
|
|
13818
|
-
|
|
13952
|
+
const node = createBaseElementAccessExpression(
|
|
13953
|
+
parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false),
|
|
13954
|
+
void 0,
|
|
13955
|
+
asExpression(index)
|
|
13956
|
+
);
|
|
13819
13957
|
if (isSuperKeyword(expression)) {
|
|
13820
13958
|
node.transformFlags |= 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */;
|
|
13821
13959
|
}
|
|
@@ -13828,31 +13966,43 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13828
13966
|
return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node;
|
|
13829
13967
|
}
|
|
13830
13968
|
function createElementAccessChain(expression, questionDotToken, index) {
|
|
13831
|
-
const node =
|
|
13969
|
+
const node = createBaseElementAccessExpression(
|
|
13970
|
+
parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true),
|
|
13971
|
+
questionDotToken,
|
|
13972
|
+
asExpression(index)
|
|
13973
|
+
);
|
|
13832
13974
|
node.flags |= 32 /* OptionalChain */;
|
|
13833
|
-
node.
|
|
13834
|
-
node.questionDotToken = questionDotToken;
|
|
13835
|
-
node.argumentExpression = asExpression(index);
|
|
13836
|
-
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression) | 32 /* ContainsES2020 */;
|
|
13975
|
+
node.transformFlags |= 32 /* ContainsES2020 */;
|
|
13837
13976
|
return node;
|
|
13838
13977
|
}
|
|
13839
13978
|
function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) {
|
|
13840
13979
|
Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead.");
|
|
13841
13980
|
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node;
|
|
13842
13981
|
}
|
|
13843
|
-
function
|
|
13844
|
-
const node =
|
|
13845
|
-
node.expression =
|
|
13846
|
-
node.
|
|
13847
|
-
node.
|
|
13848
|
-
node.
|
|
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);
|
|
13849
13989
|
if (node.typeArguments) {
|
|
13850
13990
|
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
13851
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
|
+
);
|
|
13852
14004
|
if (isImportKeyword(node.expression)) {
|
|
13853
14005
|
node.transformFlags |= 8388608 /* ContainsDynamicImport */;
|
|
13854
|
-
} else if (isSuperProperty(node.expression)) {
|
|
13855
|
-
node.transformFlags |= 16384 /* ContainsLexicalThis */;
|
|
13856
14006
|
}
|
|
13857
14007
|
return node;
|
|
13858
14008
|
}
|
|
@@ -13863,19 +14013,14 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13863
14013
|
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node;
|
|
13864
14014
|
}
|
|
13865
14015
|
function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) {
|
|
13866
|
-
const node =
|
|
14016
|
+
const node = createBaseCallExpression(
|
|
14017
|
+
parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true),
|
|
14018
|
+
questionDotToken,
|
|
14019
|
+
asNodeArray(typeArguments),
|
|
14020
|
+
parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray))
|
|
14021
|
+
);
|
|
13867
14022
|
node.flags |= 32 /* OptionalChain */;
|
|
13868
|
-
node.
|
|
13869
|
-
node.questionDotToken = questionDotToken;
|
|
13870
|
-
node.typeArguments = asNodeArray(typeArguments);
|
|
13871
|
-
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
|
|
13872
|
-
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments) | 32 /* ContainsES2020 */;
|
|
13873
|
-
if (node.typeArguments) {
|
|
13874
|
-
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
13875
|
-
}
|
|
13876
|
-
if (isSuperProperty(node.expression)) {
|
|
13877
|
-
node.transformFlags |= 16384 /* ContainsLexicalThis */;
|
|
13878
|
-
}
|
|
14023
|
+
node.transformFlags |= 32 /* ContainsES2020 */;
|
|
13879
14024
|
return node;
|
|
13880
14025
|
}
|
|
13881
14026
|
function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) {
|
|
@@ -13883,7 +14028,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13883
14028
|
return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node;
|
|
13884
14029
|
}
|
|
13885
14030
|
function createNewExpression(expression, typeArguments, argumentsArray) {
|
|
13886
|
-
const node =
|
|
14031
|
+
const node = createBaseDeclaration(211 /* NewExpression */);
|
|
13887
14032
|
node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression);
|
|
13888
14033
|
node.typeArguments = asNodeArray(typeArguments);
|
|
13889
14034
|
node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0;
|
|
@@ -13897,7 +14042,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13897
14042
|
return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node;
|
|
13898
14043
|
}
|
|
13899
14044
|
function createTaggedTemplateExpression(tag, typeArguments, template) {
|
|
13900
|
-
const node =
|
|
14045
|
+
const node = createBaseNode(212 /* TaggedTemplateExpression */);
|
|
13901
14046
|
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false);
|
|
13902
14047
|
node.typeArguments = asNodeArray(typeArguments);
|
|
13903
14048
|
node.template = template;
|
|
@@ -13914,7 +14059,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13914
14059
|
return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node;
|
|
13915
14060
|
}
|
|
13916
14061
|
function createTypeAssertion(type, expression) {
|
|
13917
|
-
const node =
|
|
14062
|
+
const node = createBaseNode(213 /* TypeAssertionExpression */);
|
|
13918
14063
|
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
|
|
13919
14064
|
node.type = type;
|
|
13920
14065
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
|
|
@@ -13924,65 +14069,67 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13924
14069
|
return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node;
|
|
13925
14070
|
}
|
|
13926
14071
|
function createParenthesizedExpression(expression) {
|
|
13927
|
-
const node =
|
|
14072
|
+
const node = createBaseNode(214 /* ParenthesizedExpression */);
|
|
13928
14073
|
node.expression = expression;
|
|
13929
14074
|
node.transformFlags = propagateChildFlags(node.expression);
|
|
14075
|
+
node.jsDoc = void 0;
|
|
14076
|
+
node.jsDocCache = void 0;
|
|
13930
14077
|
return node;
|
|
13931
14078
|
}
|
|
13932
14079
|
function updateParenthesizedExpression(node, expression) {
|
|
13933
14080
|
return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node;
|
|
13934
14081
|
}
|
|
13935
14082
|
function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
|
|
13936
|
-
const node =
|
|
13937
|
-
|
|
13938
|
-
modifiers,
|
|
13939
|
-
name,
|
|
13940
|
-
typeParameters,
|
|
13941
|
-
parameters,
|
|
13942
|
-
type,
|
|
13943
|
-
body
|
|
13944
|
-
);
|
|
14083
|
+
const node = createBaseDeclaration(215 /* FunctionExpression */);
|
|
14084
|
+
node.modifiers = asNodeArray(modifiers);
|
|
13945
14085
|
node.asteriskToken = asteriskToken;
|
|
13946
|
-
node.
|
|
13947
|
-
|
|
13948
|
-
|
|
13949
|
-
|
|
13950
|
-
|
|
13951
|
-
|
|
13952
|
-
|
|
13953
|
-
|
|
13954
|
-
|
|
13955
|
-
|
|
13956
|
-
|
|
13957
|
-
|
|
13958
|
-
|
|
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;
|
|
13959
14103
|
return node;
|
|
13960
14104
|
}
|
|
13961
14105
|
function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
|
|
13962
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;
|
|
13963
14107
|
}
|
|
13964
14108
|
function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
|
|
13965
|
-
const node =
|
|
13966
|
-
|
|
13967
|
-
|
|
13968
|
-
|
|
13969
|
-
|
|
13970
|
-
parameters,
|
|
13971
|
-
type,
|
|
13972
|
-
parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body)
|
|
13973
|
-
);
|
|
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;
|
|
13974
14114
|
node.equalsGreaterThanToken = equalsGreaterThanToken != null ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */);
|
|
13975
|
-
node.
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
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;
|
|
13979
14126
|
return node;
|
|
13980
14127
|
}
|
|
13981
14128
|
function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
|
|
13982
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;
|
|
13983
14130
|
}
|
|
13984
14131
|
function createDeleteExpression(expression) {
|
|
13985
|
-
const node =
|
|
14132
|
+
const node = createBaseNode(217 /* DeleteExpression */);
|
|
13986
14133
|
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
|
|
13987
14134
|
node.transformFlags |= propagateChildFlags(node.expression);
|
|
13988
14135
|
return node;
|
|
@@ -13991,7 +14138,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13991
14138
|
return node.expression !== expression ? update(createDeleteExpression(expression), node) : node;
|
|
13992
14139
|
}
|
|
13993
14140
|
function createTypeOfExpression(expression) {
|
|
13994
|
-
const node =
|
|
14141
|
+
const node = createBaseNode(218 /* TypeOfExpression */);
|
|
13995
14142
|
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
|
|
13996
14143
|
node.transformFlags |= propagateChildFlags(node.expression);
|
|
13997
14144
|
return node;
|
|
@@ -14000,7 +14147,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14000
14147
|
return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node;
|
|
14001
14148
|
}
|
|
14002
14149
|
function createVoidExpression(expression) {
|
|
14003
|
-
const node =
|
|
14150
|
+
const node = createBaseNode(219 /* VoidExpression */);
|
|
14004
14151
|
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
|
|
14005
14152
|
node.transformFlags |= propagateChildFlags(node.expression);
|
|
14006
14153
|
return node;
|
|
@@ -14009,7 +14156,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14009
14156
|
return node.expression !== expression ? update(createVoidExpression(expression), node) : node;
|
|
14010
14157
|
}
|
|
14011
14158
|
function createAwaitExpression(expression) {
|
|
14012
|
-
const node =
|
|
14159
|
+
const node = createBaseNode(220 /* AwaitExpression */);
|
|
14013
14160
|
node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression);
|
|
14014
14161
|
node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */;
|
|
14015
14162
|
return node;
|
|
@@ -14018,7 +14165,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14018
14165
|
return node.expression !== expression ? update(createAwaitExpression(expression), node) : node;
|
|
14019
14166
|
}
|
|
14020
14167
|
function createPrefixUnaryExpression(operator, operand) {
|
|
14021
|
-
const node =
|
|
14168
|
+
const node = createBaseNode(221 /* PrefixUnaryExpression */);
|
|
14022
14169
|
node.operator = operator;
|
|
14023
14170
|
node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand);
|
|
14024
14171
|
node.transformFlags |= propagateChildFlags(node.operand);
|
|
@@ -14031,7 +14178,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14031
14178
|
return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node;
|
|
14032
14179
|
}
|
|
14033
14180
|
function createPostfixUnaryExpression(operand, operator) {
|
|
14034
|
-
const node =
|
|
14181
|
+
const node = createBaseNode(222 /* PostfixUnaryExpression */);
|
|
14035
14182
|
node.operator = operator;
|
|
14036
14183
|
node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand);
|
|
14037
14184
|
node.transformFlags |= propagateChildFlags(node.operand);
|
|
@@ -14044,7 +14191,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14044
14191
|
return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node;
|
|
14045
14192
|
}
|
|
14046
14193
|
function createBinaryExpression(left, operator, right) {
|
|
14047
|
-
const node =
|
|
14194
|
+
const node = createBaseDeclaration(223 /* BinaryExpression */);
|
|
14048
14195
|
const operatorToken = asToken(operator);
|
|
14049
14196
|
const operatorKind = operatorToken.kind;
|
|
14050
14197
|
node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left);
|
|
@@ -14067,6 +14214,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14067
14214
|
if (operatorKind === 101 /* InKeyword */ && isPrivateIdentifier(node.left)) {
|
|
14068
14215
|
node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */;
|
|
14069
14216
|
}
|
|
14217
|
+
node.jsDoc = void 0;
|
|
14218
|
+
node.jsDocCache = void 0;
|
|
14070
14219
|
return node;
|
|
14071
14220
|
}
|
|
14072
14221
|
function propagateAssignmentPatternFlags(node) {
|
|
@@ -14093,7 +14242,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14093
14242
|
return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node;
|
|
14094
14243
|
}
|
|
14095
14244
|
function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {
|
|
14096
|
-
const node =
|
|
14245
|
+
const node = createBaseNode(224 /* ConditionalExpression */);
|
|
14097
14246
|
node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition);
|
|
14098
14247
|
node.questionToken = questionToken != null ? questionToken : createToken(57 /* QuestionToken */);
|
|
14099
14248
|
node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue);
|
|
@@ -14106,7 +14255,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14106
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;
|
|
14107
14256
|
}
|
|
14108
14257
|
function createTemplateExpression(head, templateSpans) {
|
|
14109
|
-
const node =
|
|
14258
|
+
const node = createBaseNode(225 /* TemplateExpression */);
|
|
14110
14259
|
node.head = head;
|
|
14111
14260
|
node.templateSpans = createNodeArray(templateSpans);
|
|
14112
14261
|
node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */;
|
|
@@ -14115,7 +14264,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14115
14264
|
function updateTemplateExpression(node, head, templateSpans) {
|
|
14116
14265
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression(head, templateSpans), node) : node;
|
|
14117
14266
|
}
|
|
14118
|
-
function
|
|
14267
|
+
function checkTemplateLiteralLikeNode(kind, text, rawText, templateFlags = 0 /* None */) {
|
|
14119
14268
|
Debug.assert(!(templateFlags & ~2048 /* TemplateLiteralLikeFlags */), "Unsupported template flags.");
|
|
14120
14269
|
let cooked = void 0;
|
|
14121
14270
|
if (rawText !== void 0 && rawText !== text) {
|
|
@@ -14132,34 +14281,56 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14132
14281
|
} else if (cooked !== void 0) {
|
|
14133
14282
|
Debug.assert(text === cooked, "Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");
|
|
14134
14283
|
}
|
|
14135
|
-
return
|
|
14284
|
+
return text;
|
|
14136
14285
|
}
|
|
14137
|
-
function
|
|
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) {
|
|
14138
14294
|
const node = createBaseToken(kind);
|
|
14139
14295
|
node.text = text;
|
|
14140
14296
|
node.rawText = rawText;
|
|
14141
14297
|
node.templateFlags = templateFlags & 2048 /* TemplateLiteralLikeFlags */;
|
|
14142
|
-
node.transformFlags
|
|
14143
|
-
if (node.templateFlags) {
|
|
14144
|
-
node.transformFlags |= 128 /* ContainsES2018 */;
|
|
14145
|
-
}
|
|
14298
|
+
node.transformFlags = getTransformFlagsOfTemplateLiteralLike(node.templateFlags);
|
|
14146
14299
|
return node;
|
|
14147
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);
|
|
14307
|
+
return node;
|
|
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
|
+
}
|
|
14148
14315
|
function createTemplateHead(text, rawText, templateFlags) {
|
|
14149
|
-
|
|
14316
|
+
text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
|
|
14317
|
+
return createTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
|
|
14150
14318
|
}
|
|
14151
14319
|
function createTemplateMiddle(text, rawText, templateFlags) {
|
|
14152
|
-
|
|
14320
|
+
text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
|
|
14321
|
+
return createTemplateLiteralLikeNode(16 /* TemplateMiddle */, text, rawText, templateFlags);
|
|
14153
14322
|
}
|
|
14154
14323
|
function createTemplateTail(text, rawText, templateFlags) {
|
|
14155
|
-
|
|
14324
|
+
text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
|
|
14325
|
+
return createTemplateLiteralLikeNode(17 /* TemplateTail */, text, rawText, templateFlags);
|
|
14156
14326
|
}
|
|
14157
14327
|
function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) {
|
|
14158
|
-
|
|
14328
|
+
text = checkTemplateLiteralLikeNode(15 /* TemplateHead */, text, rawText, templateFlags);
|
|
14329
|
+
return createTemplateLiteralLikeDeclaration(14 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags);
|
|
14159
14330
|
}
|
|
14160
14331
|
function createYieldExpression(asteriskToken, expression) {
|
|
14161
14332
|
Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression.");
|
|
14162
|
-
const node =
|
|
14333
|
+
const node = createBaseNode(226 /* YieldExpression */);
|
|
14163
14334
|
node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
|
|
14164
14335
|
node.asteriskToken = asteriskToken;
|
|
14165
14336
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */;
|
|
@@ -14169,7 +14340,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14169
14340
|
return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node;
|
|
14170
14341
|
}
|
|
14171
14342
|
function createSpreadElement(expression) {
|
|
14172
|
-
const node =
|
|
14343
|
+
const node = createBaseNode(227 /* SpreadElement */);
|
|
14173
14344
|
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
|
|
14174
14345
|
node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */;
|
|
14175
14346
|
return node;
|
|
@@ -14178,22 +14349,22 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14178
14349
|
return node.expression !== expression ? update(createSpreadElement(expression), node) : node;
|
|
14179
14350
|
}
|
|
14180
14351
|
function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) {
|
|
14181
|
-
const node =
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
|
|
14188
|
-
|
|
14189
|
-
node.
|
|
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;
|
|
14190
14361
|
return node;
|
|
14191
14362
|
}
|
|
14192
14363
|
function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) {
|
|
14193
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;
|
|
14194
14365
|
}
|
|
14195
14366
|
function createOmittedExpression() {
|
|
14196
|
-
return
|
|
14367
|
+
return createBaseNode(229 /* OmittedExpression */);
|
|
14197
14368
|
}
|
|
14198
14369
|
function createExpressionWithTypeArguments(expression, typeArguments) {
|
|
14199
14370
|
const node = createBaseNode(230 /* ExpressionWithTypeArguments */);
|
|
@@ -14206,7 +14377,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14206
14377
|
return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node;
|
|
14207
14378
|
}
|
|
14208
14379
|
function createAsExpression(expression, type) {
|
|
14209
|
-
const node =
|
|
14380
|
+
const node = createBaseNode(231 /* AsExpression */);
|
|
14210
14381
|
node.expression = expression;
|
|
14211
14382
|
node.type = type;
|
|
14212
14383
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
|
|
@@ -14216,7 +14387,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14216
14387
|
return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node;
|
|
14217
14388
|
}
|
|
14218
14389
|
function createNonNullExpression(expression) {
|
|
14219
|
-
const node =
|
|
14390
|
+
const node = createBaseNode(232 /* NonNullExpression */);
|
|
14220
14391
|
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false);
|
|
14221
14392
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
14222
14393
|
return node;
|
|
@@ -14228,7 +14399,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14228
14399
|
return node.expression !== expression ? update(createNonNullExpression(expression), node) : node;
|
|
14229
14400
|
}
|
|
14230
14401
|
function createSatisfiesExpression(expression, type) {
|
|
14231
|
-
const node =
|
|
14402
|
+
const node = createBaseNode(235 /* SatisfiesExpression */);
|
|
14232
14403
|
node.expression = expression;
|
|
14233
14404
|
node.type = type;
|
|
14234
14405
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */;
|
|
@@ -14238,7 +14409,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14238
14409
|
return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node;
|
|
14239
14410
|
}
|
|
14240
14411
|
function createNonNullChain(expression) {
|
|
14241
|
-
const node =
|
|
14412
|
+
const node = createBaseNode(232 /* NonNullExpression */);
|
|
14242
14413
|
node.flags |= 32 /* OptionalChain */;
|
|
14243
14414
|
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true);
|
|
14244
14415
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -14249,7 +14420,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14249
14420
|
return node.expression !== expression ? update(createNonNullChain(expression), node) : node;
|
|
14250
14421
|
}
|
|
14251
14422
|
function createMetaProperty(keywordToken, name) {
|
|
14252
|
-
const node =
|
|
14423
|
+
const node = createBaseNode(233 /* MetaProperty */);
|
|
14253
14424
|
node.keywordToken = keywordToken;
|
|
14254
14425
|
node.name = name;
|
|
14255
14426
|
node.transformFlags |= propagateChildFlags(node.name);
|
|
@@ -14263,6 +14434,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14263
14434
|
default:
|
|
14264
14435
|
return Debug.assertNever(keywordToken);
|
|
14265
14436
|
}
|
|
14437
|
+
node.flowNode = void 0;
|
|
14266
14438
|
return node;
|
|
14267
14439
|
}
|
|
14268
14440
|
function updateMetaProperty(node, name) {
|
|
@@ -14288,31 +14460,45 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14288
14460
|
node.statements = createNodeArray(statements);
|
|
14289
14461
|
node.multiLine = multiLine;
|
|
14290
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;
|
|
14291
14467
|
return node;
|
|
14292
14468
|
}
|
|
14293
14469
|
function updateBlock(node, statements) {
|
|
14294
14470
|
return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node;
|
|
14295
14471
|
}
|
|
14296
14472
|
function createVariableStatement(modifiers, declarationList) {
|
|
14297
|
-
const node =
|
|
14473
|
+
const node = createBaseNode(240 /* VariableStatement */);
|
|
14298
14474
|
node.modifiers = asNodeArray(modifiers);
|
|
14299
14475
|
node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList;
|
|
14300
14476
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList);
|
|
14301
14477
|
if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
|
|
14302
14478
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
14303
14479
|
}
|
|
14480
|
+
node.illegalDecorators = void 0;
|
|
14481
|
+
node.jsDoc = void 0;
|
|
14482
|
+
node.jsDocCache = void 0;
|
|
14483
|
+
node.flowNode = void 0;
|
|
14304
14484
|
return node;
|
|
14305
14485
|
}
|
|
14306
14486
|
function updateVariableStatement(node, modifiers, declarationList) {
|
|
14307
14487
|
return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node;
|
|
14308
14488
|
}
|
|
14309
14489
|
function createEmptyStatement() {
|
|
14310
|
-
|
|
14490
|
+
const node = createBaseNode(239 /* EmptyStatement */);
|
|
14491
|
+
node.jsDoc = void 0;
|
|
14492
|
+
node.jsDocCache = void 0;
|
|
14493
|
+
return node;
|
|
14311
14494
|
}
|
|
14312
14495
|
function createExpressionStatement(expression) {
|
|
14313
14496
|
const node = createBaseNode(241 /* ExpressionStatement */);
|
|
14314
14497
|
node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
|
|
14315
14498
|
node.transformFlags |= propagateChildFlags(node.expression);
|
|
14499
|
+
node.jsDoc = void 0;
|
|
14500
|
+
node.jsDocCache = void 0;
|
|
14501
|
+
node.flowNode = void 0;
|
|
14316
14502
|
return node;
|
|
14317
14503
|
}
|
|
14318
14504
|
function updateExpressionStatement(node, expression) {
|
|
@@ -14324,6 +14510,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14324
14510
|
node.thenStatement = asEmbeddedStatement(thenStatement);
|
|
14325
14511
|
node.elseStatement = asEmbeddedStatement(elseStatement);
|
|
14326
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;
|
|
14327
14516
|
return node;
|
|
14328
14517
|
}
|
|
14329
14518
|
function updateIfStatement(node, expression, thenStatement, elseStatement) {
|
|
@@ -14334,6 +14523,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14334
14523
|
node.statement = asEmbeddedStatement(statement);
|
|
14335
14524
|
node.expression = expression;
|
|
14336
14525
|
node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
|
|
14526
|
+
node.jsDoc = void 0;
|
|
14527
|
+
node.jsDocCache = void 0;
|
|
14528
|
+
node.flowNode = void 0;
|
|
14337
14529
|
return node;
|
|
14338
14530
|
}
|
|
14339
14531
|
function updateDoStatement(node, statement, expression) {
|
|
@@ -14344,6 +14536,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14344
14536
|
node.expression = expression;
|
|
14345
14537
|
node.statement = asEmbeddedStatement(statement);
|
|
14346
14538
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
|
|
14539
|
+
node.jsDoc = void 0;
|
|
14540
|
+
node.jsDocCache = void 0;
|
|
14541
|
+
node.flowNode = void 0;
|
|
14347
14542
|
return node;
|
|
14348
14543
|
}
|
|
14349
14544
|
function updateWhileStatement(node, expression, statement) {
|
|
@@ -14356,6 +14551,11 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14356
14551
|
node.incrementor = incrementor;
|
|
14357
14552
|
node.statement = asEmbeddedStatement(statement);
|
|
14358
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;
|
|
14359
14559
|
return node;
|
|
14360
14560
|
}
|
|
14361
14561
|
function updateForStatement(node, initializer, condition, incrementor, statement) {
|
|
@@ -14367,6 +14567,11 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14367
14567
|
node.expression = expression;
|
|
14368
14568
|
node.statement = asEmbeddedStatement(statement);
|
|
14369
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;
|
|
14370
14575
|
return node;
|
|
14371
14576
|
}
|
|
14372
14577
|
function updateForInStatement(node, initializer, expression, statement) {
|
|
@@ -14381,6 +14586,11 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14381
14586
|
node.transformFlags |= propagateChildFlags(node.awaitModifier) | propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement) | 1024 /* ContainsES2015 */;
|
|
14382
14587
|
if (awaitModifier)
|
|
14383
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;
|
|
14384
14594
|
return node;
|
|
14385
14595
|
}
|
|
14386
14596
|
function updateForOfStatement(node, awaitModifier, initializer, expression, statement) {
|
|
@@ -14390,6 +14600,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14390
14600
|
const node = createBaseNode(248 /* ContinueStatement */);
|
|
14391
14601
|
node.label = asName(label);
|
|
14392
14602
|
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
|
|
14603
|
+
node.jsDoc = void 0;
|
|
14604
|
+
node.jsDocCache = void 0;
|
|
14605
|
+
node.flowNode = void 0;
|
|
14393
14606
|
return node;
|
|
14394
14607
|
}
|
|
14395
14608
|
function updateContinueStatement(node, label) {
|
|
@@ -14399,6 +14612,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14399
14612
|
const node = createBaseNode(249 /* BreakStatement */);
|
|
14400
14613
|
node.label = asName(label);
|
|
14401
14614
|
node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
|
|
14615
|
+
node.jsDoc = void 0;
|
|
14616
|
+
node.jsDocCache = void 0;
|
|
14617
|
+
node.flowNode = void 0;
|
|
14402
14618
|
return node;
|
|
14403
14619
|
}
|
|
14404
14620
|
function updateBreakStatement(node, label) {
|
|
@@ -14408,6 +14624,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14408
14624
|
const node = createBaseNode(250 /* ReturnStatement */);
|
|
14409
14625
|
node.expression = expression;
|
|
14410
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;
|
|
14411
14630
|
return node;
|
|
14412
14631
|
}
|
|
14413
14632
|
function updateReturnStatement(node, expression) {
|
|
@@ -14418,6 +14637,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14418
14637
|
node.expression = expression;
|
|
14419
14638
|
node.statement = asEmbeddedStatement(statement);
|
|
14420
14639
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
|
|
14640
|
+
node.jsDoc = void 0;
|
|
14641
|
+
node.jsDocCache = void 0;
|
|
14642
|
+
node.flowNode = void 0;
|
|
14421
14643
|
return node;
|
|
14422
14644
|
}
|
|
14423
14645
|
function updateWithStatement(node, expression, statement) {
|
|
@@ -14428,6 +14650,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14428
14650
|
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
|
|
14429
14651
|
node.caseBlock = caseBlock;
|
|
14430
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;
|
|
14431
14657
|
return node;
|
|
14432
14658
|
}
|
|
14433
14659
|
function updateSwitchStatement(node, expression, caseBlock) {
|
|
@@ -14438,6 +14664,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14438
14664
|
node.label = asName(label);
|
|
14439
14665
|
node.statement = asEmbeddedStatement(statement);
|
|
14440
14666
|
node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
|
|
14667
|
+
node.jsDoc = void 0;
|
|
14668
|
+
node.jsDocCache = void 0;
|
|
14669
|
+
node.flowNode = void 0;
|
|
14441
14670
|
return node;
|
|
14442
14671
|
}
|
|
14443
14672
|
function updateLabeledStatement(node, label, statement) {
|
|
@@ -14447,6 +14676,9 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14447
14676
|
const node = createBaseNode(254 /* ThrowStatement */);
|
|
14448
14677
|
node.expression = expression;
|
|
14449
14678
|
node.transformFlags |= propagateChildFlags(node.expression);
|
|
14679
|
+
node.jsDoc = void 0;
|
|
14680
|
+
node.jsDocCache = void 0;
|
|
14681
|
+
node.flowNode = void 0;
|
|
14450
14682
|
return node;
|
|
14451
14683
|
}
|
|
14452
14684
|
function updateThrowStatement(node, expression) {
|
|
@@ -14458,27 +14690,31 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14458
14690
|
node.catchClause = catchClause;
|
|
14459
14691
|
node.finallyBlock = finallyBlock;
|
|
14460
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;
|
|
14461
14696
|
return node;
|
|
14462
14697
|
}
|
|
14463
14698
|
function updateTryStatement(node, tryBlock, catchClause, finallyBlock) {
|
|
14464
14699
|
return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node;
|
|
14465
14700
|
}
|
|
14466
14701
|
function createDebuggerStatement() {
|
|
14467
|
-
|
|
14702
|
+
const node = createBaseNode(256 /* DebuggerStatement */);
|
|
14703
|
+
node.jsDoc = void 0;
|
|
14704
|
+
node.jsDocCache = void 0;
|
|
14705
|
+
node.flowNode = void 0;
|
|
14706
|
+
return node;
|
|
14468
14707
|
}
|
|
14469
14708
|
function createVariableDeclaration(name, exclamationToken, type, initializer) {
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
|
|
14473
|
-
name,
|
|
14474
|
-
type,
|
|
14475
|
-
initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer)
|
|
14476
|
-
);
|
|
14709
|
+
var _a2;
|
|
14710
|
+
const node = createBaseDeclaration(257 /* VariableDeclaration */);
|
|
14711
|
+
node.name = asName(name);
|
|
14477
14712
|
node.exclamationToken = exclamationToken;
|
|
14478
|
-
node.
|
|
14479
|
-
|
|
14480
|
-
|
|
14481
|
-
|
|
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;
|
|
14482
14718
|
return node;
|
|
14483
14719
|
}
|
|
14484
14720
|
function updateVariableDeclaration(node, name, exclamationToken, type, initializer) {
|
|
@@ -14498,31 +14734,30 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14498
14734
|
return node.declarations !== declarations ? update(createVariableDeclarationList(declarations, node.flags), node) : node;
|
|
14499
14735
|
}
|
|
14500
14736
|
function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
|
|
14501
|
-
const node =
|
|
14502
|
-
|
|
14503
|
-
modifiers,
|
|
14504
|
-
name,
|
|
14505
|
-
typeParameters,
|
|
14506
|
-
parameters,
|
|
14507
|
-
type,
|
|
14508
|
-
body
|
|
14509
|
-
);
|
|
14737
|
+
const node = createBaseDeclaration(259 /* FunctionDeclaration */);
|
|
14738
|
+
node.modifiers = asNodeArray(modifiers);
|
|
14510
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;
|
|
14511
14745
|
if (!node.body || modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
|
|
14512
14746
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
14513
14747
|
} else {
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
} else {
|
|
14519
|
-
node.transformFlags |= 256 /* ContainsES2017 */;
|
|
14520
|
-
}
|
|
14521
|
-
} else if (node.asteriskToken) {
|
|
14522
|
-
node.transformFlags |= 2048 /* ContainsGenerator */;
|
|
14523
|
-
}
|
|
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 */;
|
|
14524
14752
|
}
|
|
14525
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;
|
|
14526
14761
|
return node;
|
|
14527
14762
|
}
|
|
14528
14763
|
function updateFunctionDeclaration(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
|
|
@@ -14535,38 +14770,38 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14535
14770
|
return finishUpdateBaseSignatureDeclaration(updated, original);
|
|
14536
14771
|
}
|
|
14537
14772
|
function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
|
|
14538
|
-
const node =
|
|
14539
|
-
|
|
14540
|
-
|
|
14541
|
-
|
|
14542
|
-
|
|
14543
|
-
|
|
14544
|
-
members
|
|
14545
|
-
);
|
|
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);
|
|
14546
14779
|
if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) {
|
|
14547
14780
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
14548
14781
|
} else {
|
|
14549
|
-
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 */;
|
|
14550
14783
|
if (node.transformFlags & 8192 /* ContainsTypeScriptClassSyntax */) {
|
|
14551
14784
|
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
14552
14785
|
}
|
|
14553
14786
|
}
|
|
14787
|
+
node.jsDoc = void 0;
|
|
14788
|
+
node.jsDocCache = void 0;
|
|
14554
14789
|
return node;
|
|
14555
14790
|
}
|
|
14556
14791
|
function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
|
|
14557
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;
|
|
14558
14793
|
}
|
|
14559
14794
|
function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
|
|
14560
|
-
const node =
|
|
14561
|
-
|
|
14562
|
-
|
|
14563
|
-
|
|
14564
|
-
|
|
14565
|
-
heritageClauses
|
|
14566
|
-
);
|
|
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);
|
|
14567
14800
|
node.members = createNodeArray(members);
|
|
14568
14801
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
14569
14802
|
node.illegalDecorators = void 0;
|
|
14803
|
+
node.jsDoc = void 0;
|
|
14804
|
+
node.jsDocCache = void 0;
|
|
14570
14805
|
return node;
|
|
14571
14806
|
}
|
|
14572
14807
|
function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
|
|
@@ -14579,15 +14814,17 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14579
14814
|
return update(updated, original);
|
|
14580
14815
|
}
|
|
14581
14816
|
function createTypeAliasDeclaration(modifiers, name, typeParameters, type) {
|
|
14582
|
-
const node =
|
|
14583
|
-
|
|
14584
|
-
|
|
14585
|
-
|
|
14586
|
-
typeParameters
|
|
14587
|
-
);
|
|
14817
|
+
const node = createBaseDeclaration(262 /* TypeAliasDeclaration */);
|
|
14818
|
+
node.modifiers = asNodeArray(modifiers);
|
|
14819
|
+
node.name = asName(name);
|
|
14820
|
+
node.typeParameters = asNodeArray(typeParameters);
|
|
14588
14821
|
node.type = type;
|
|
14589
14822
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
14590
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;
|
|
14591
14828
|
return node;
|
|
14592
14829
|
}
|
|
14593
14830
|
function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) {
|
|
@@ -14600,15 +14837,15 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14600
14837
|
return update(updated, original);
|
|
14601
14838
|
}
|
|
14602
14839
|
function createEnumDeclaration(modifiers, name, members) {
|
|
14603
|
-
const node =
|
|
14604
|
-
|
|
14605
|
-
|
|
14606
|
-
name
|
|
14607
|
-
);
|
|
14840
|
+
const node = createBaseDeclaration(263 /* EnumDeclaration */);
|
|
14841
|
+
node.modifiers = asNodeArray(modifiers);
|
|
14842
|
+
node.name = asName(name);
|
|
14608
14843
|
node.members = createNodeArray(members);
|
|
14609
|
-
node.transformFlags |= propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */;
|
|
14844
|
+
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */;
|
|
14610
14845
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
14611
14846
|
node.illegalDecorators = void 0;
|
|
14847
|
+
node.jsDoc = void 0;
|
|
14848
|
+
node.jsDocCache = void 0;
|
|
14612
14849
|
return node;
|
|
14613
14850
|
}
|
|
14614
14851
|
function updateEnumDeclaration(node, modifiers, name, members) {
|
|
@@ -14633,6 +14870,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14633
14870
|
}
|
|
14634
14871
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
14635
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;
|
|
14636
14877
|
return node;
|
|
14637
14878
|
}
|
|
14638
14879
|
function updateModuleDeclaration(node, modifiers, name, body) {
|
|
@@ -14648,6 +14889,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14648
14889
|
const node = createBaseNode(265 /* ModuleBlock */);
|
|
14649
14890
|
node.statements = createNodeArray(statements);
|
|
14650
14891
|
node.transformFlags |= propagateChildrenFlags(node.statements);
|
|
14892
|
+
node.jsDoc = void 0;
|
|
14893
|
+
node.jsDocCache = void 0;
|
|
14651
14894
|
return node;
|
|
14652
14895
|
}
|
|
14653
14896
|
function updateModuleBlock(node, statements) {
|
|
@@ -14657,20 +14900,21 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14657
14900
|
const node = createBaseNode(266 /* CaseBlock */);
|
|
14658
14901
|
node.clauses = createNodeArray(clauses);
|
|
14659
14902
|
node.transformFlags |= propagateChildrenFlags(node.clauses);
|
|
14903
|
+
node.locals = void 0;
|
|
14904
|
+
node.nextContainer = void 0;
|
|
14660
14905
|
return node;
|
|
14661
14906
|
}
|
|
14662
14907
|
function updateCaseBlock(node, clauses) {
|
|
14663
14908
|
return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node;
|
|
14664
14909
|
}
|
|
14665
14910
|
function createNamespaceExportDeclaration(name) {
|
|
14666
|
-
const node =
|
|
14667
|
-
|
|
14668
|
-
|
|
14669
|
-
name
|
|
14670
|
-
);
|
|
14671
|
-
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
14911
|
+
const node = createBaseDeclaration(267 /* NamespaceExportDeclaration */);
|
|
14912
|
+
node.name = asName(name);
|
|
14913
|
+
node.transformFlags |= propagateIdentifierNameFlags(node.name) | 1 /* ContainsTypeScript */;
|
|
14672
14914
|
node.illegalDecorators = void 0;
|
|
14673
14915
|
node.modifiers = void 0;
|
|
14916
|
+
node.jsDoc = void 0;
|
|
14917
|
+
node.jsDocCache = void 0;
|
|
14674
14918
|
return node;
|
|
14675
14919
|
}
|
|
14676
14920
|
function updateNamespaceExportDeclaration(node, name) {
|
|
@@ -14684,18 +14928,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14684
14928
|
return update(updated, original);
|
|
14685
14929
|
}
|
|
14686
14930
|
function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) {
|
|
14687
|
-
const node =
|
|
14688
|
-
|
|
14689
|
-
|
|
14690
|
-
name
|
|
14691
|
-
);
|
|
14931
|
+
const node = createBaseDeclaration(268 /* ImportEqualsDeclaration */);
|
|
14932
|
+
node.modifiers = asNodeArray(modifiers);
|
|
14933
|
+
node.name = asName(name);
|
|
14692
14934
|
node.isTypeOnly = isTypeOnly;
|
|
14693
14935
|
node.moduleReference = moduleReference;
|
|
14694
|
-
node.transformFlags |= propagateChildFlags(node.moduleReference);
|
|
14695
|
-
if (!isExternalModuleReference(node.moduleReference))
|
|
14936
|
+
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.moduleReference);
|
|
14937
|
+
if (!isExternalModuleReference(node.moduleReference)) {
|
|
14696
14938
|
node.transformFlags |= 1 /* ContainsTypeScript */;
|
|
14939
|
+
}
|
|
14697
14940
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
14698
14941
|
node.illegalDecorators = void 0;
|
|
14942
|
+
node.jsDoc = void 0;
|
|
14943
|
+
node.jsDocCache = void 0;
|
|
14699
14944
|
return node;
|
|
14700
14945
|
}
|
|
14701
14946
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
@@ -14708,7 +14953,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14708
14953
|
return update(updated, original);
|
|
14709
14954
|
}
|
|
14710
14955
|
function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) {
|
|
14711
|
-
const node =
|
|
14956
|
+
const node = createBaseNode(269 /* ImportDeclaration */);
|
|
14712
14957
|
node.modifiers = asNodeArray(modifiers);
|
|
14713
14958
|
node.importClause = importClause;
|
|
14714
14959
|
node.moduleSpecifier = moduleSpecifier;
|
|
@@ -14716,6 +14961,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14716
14961
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
14717
14962
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
14718
14963
|
node.illegalDecorators = void 0;
|
|
14964
|
+
node.jsDoc = void 0;
|
|
14965
|
+
node.jsDocCache = void 0;
|
|
14719
14966
|
return node;
|
|
14720
14967
|
}
|
|
14721
14968
|
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) {
|
|
@@ -14728,7 +14975,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14728
14975
|
return update(updated, original);
|
|
14729
14976
|
}
|
|
14730
14977
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
14731
|
-
const node =
|
|
14978
|
+
const node = createBaseDeclaration(270 /* ImportClause */);
|
|
14732
14979
|
node.isTypeOnly = isTypeOnly;
|
|
14733
14980
|
node.name = name;
|
|
14734
14981
|
node.namedBindings = namedBindings;
|
|
@@ -14772,7 +15019,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14772
15019
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
14773
15020
|
}
|
|
14774
15021
|
function createNamespaceImport(name) {
|
|
14775
|
-
const node =
|
|
15022
|
+
const node = createBaseDeclaration(271 /* NamespaceImport */);
|
|
14776
15023
|
node.name = name;
|
|
14777
15024
|
node.transformFlags |= propagateChildFlags(node.name);
|
|
14778
15025
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
@@ -14782,7 +15029,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14782
15029
|
return node.name !== name ? update(createNamespaceImport(name), node) : node;
|
|
14783
15030
|
}
|
|
14784
15031
|
function createNamespaceExport(name) {
|
|
14785
|
-
const node =
|
|
15032
|
+
const node = createBaseDeclaration(277 /* NamespaceExport */);
|
|
14786
15033
|
node.name = name;
|
|
14787
15034
|
node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */;
|
|
14788
15035
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
@@ -14802,7 +15049,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14802
15049
|
return node.elements !== elements ? update(createNamedImports(elements), node) : node;
|
|
14803
15050
|
}
|
|
14804
15051
|
function createImportSpecifier(isTypeOnly, propertyName, name) {
|
|
14805
|
-
const node =
|
|
15052
|
+
const node = createBaseDeclaration(273 /* ImportSpecifier */);
|
|
14806
15053
|
node.isTypeOnly = isTypeOnly;
|
|
14807
15054
|
node.propertyName = propertyName;
|
|
14808
15055
|
node.name = name;
|
|
@@ -14821,6 +15068,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14821
15068
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression);
|
|
14822
15069
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
14823
15070
|
node.illegalDecorators = void 0;
|
|
15071
|
+
node.jsDoc = void 0;
|
|
15072
|
+
node.jsDocCache = void 0;
|
|
14824
15073
|
return node;
|
|
14825
15074
|
}
|
|
14826
15075
|
function updateExportAssignment(node, modifiers, expression) {
|
|
@@ -14842,6 +15091,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14842
15091
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
14843
15092
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
14844
15093
|
node.illegalDecorators = void 0;
|
|
15094
|
+
node.jsDoc = void 0;
|
|
15095
|
+
node.jsDocCache = void 0;
|
|
14845
15096
|
return node;
|
|
14846
15097
|
}
|
|
14847
15098
|
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
|
|
@@ -14870,6 +15121,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14870
15121
|
node.name = asName(name);
|
|
14871
15122
|
node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name);
|
|
14872
15123
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
15124
|
+
node.jsDoc = void 0;
|
|
15125
|
+
node.jsDocCache = void 0;
|
|
14873
15126
|
return node;
|
|
14874
15127
|
}
|
|
14875
15128
|
function updateExportSpecifier(node, isTypeOnly, propertyName, name) {
|
|
@@ -14877,6 +15130,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14877
15130
|
}
|
|
14878
15131
|
function createMissingDeclaration() {
|
|
14879
15132
|
const node = createBaseDeclaration(279 /* MissingDeclaration */);
|
|
15133
|
+
node.jsDoc = void 0;
|
|
15134
|
+
node.jsDocCache = void 0;
|
|
14880
15135
|
return node;
|
|
14881
15136
|
}
|
|
14882
15137
|
function createExternalModuleReference(expression) {
|
|
@@ -14912,21 +15167,22 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14912
15167
|
return node.type !== type ? update(createJSDocUnaryTypeWorker(kind, type), node) : node;
|
|
14913
15168
|
}
|
|
14914
15169
|
function createJSDocFunctionType(parameters, type) {
|
|
14915
|
-
const node =
|
|
14916
|
-
|
|
14917
|
-
|
|
14918
|
-
|
|
14919
|
-
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
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;
|
|
14923
15179
|
return node;
|
|
14924
15180
|
}
|
|
14925
15181
|
function updateJSDocFunctionType(node, parameters, type) {
|
|
14926
15182
|
return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node;
|
|
14927
15183
|
}
|
|
14928
15184
|
function createJSDocTypeLiteral(propertyTags, isArrayType = false) {
|
|
14929
|
-
const node =
|
|
15185
|
+
const node = createBaseDeclaration(325 /* JSDocTypeLiteral */);
|
|
14930
15186
|
node.jsDocPropertyTags = asNodeArray(propertyTags);
|
|
14931
15187
|
node.isArrayType = isArrayType;
|
|
14932
15188
|
return node;
|
|
@@ -14943,10 +15199,14 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14943
15199
|
return node.type !== type ? update(createJSDocTypeExpression(type), node) : node;
|
|
14944
15200
|
}
|
|
14945
15201
|
function createJSDocSignature(typeParameters, parameters, type) {
|
|
14946
|
-
const node =
|
|
15202
|
+
const node = createBaseDeclaration(326 /* JSDocSignature */);
|
|
14947
15203
|
node.typeParameters = asNodeArray(typeParameters);
|
|
14948
15204
|
node.parameters = createNodeArray(parameters);
|
|
14949
15205
|
node.type = type;
|
|
15206
|
+
node.jsDoc = void 0;
|
|
15207
|
+
node.jsDocCache = void 0;
|
|
15208
|
+
node.locals = void 0;
|
|
15209
|
+
node.nextContainer = void 0;
|
|
14950
15210
|
return node;
|
|
14951
15211
|
}
|
|
14952
15212
|
function updateJSDocSignature(node, typeParameters, parameters, type) {
|
|
@@ -14962,8 +15222,14 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14962
15222
|
node.comment = comment;
|
|
14963
15223
|
return node;
|
|
14964
15224
|
}
|
|
15225
|
+
function createBaseJSDocTagDeclaration(kind, tagName, comment) {
|
|
15226
|
+
const node = createBaseDeclaration(kind);
|
|
15227
|
+
node.tagName = tagName;
|
|
15228
|
+
node.comment = comment;
|
|
15229
|
+
return node;
|
|
15230
|
+
}
|
|
14965
15231
|
function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) {
|
|
14966
|
-
const node = createBaseJSDocTag(
|
|
15232
|
+
const node = createBaseJSDocTag(348 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment);
|
|
14967
15233
|
node.constraint = constraint;
|
|
14968
15234
|
node.typeParameters = createNodeArray(typeParameters);
|
|
14969
15235
|
return node;
|
|
@@ -14972,17 +15238,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14972
15238
|
return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node;
|
|
14973
15239
|
}
|
|
14974
15240
|
function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) {
|
|
14975
|
-
const node =
|
|
15241
|
+
const node = createBaseJSDocTagDeclaration(349 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment);
|
|
14976
15242
|
node.typeExpression = typeExpression;
|
|
14977
15243
|
node.fullName = fullName;
|
|
14978
15244
|
node.name = getJSDocTypeAliasName(fullName);
|
|
15245
|
+
node.locals = void 0;
|
|
15246
|
+
node.nextContainer = void 0;
|
|
14979
15247
|
return node;
|
|
14980
15248
|
}
|
|
14981
15249
|
function updateJSDocTypedefTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) {
|
|
14982
15250
|
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node;
|
|
14983
15251
|
}
|
|
14984
15252
|
function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
|
|
14985
|
-
const node =
|
|
15253
|
+
const node = createBaseJSDocTagDeclaration(344 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment);
|
|
14986
15254
|
node.typeExpression = typeExpression;
|
|
14987
15255
|
node.name = name;
|
|
14988
15256
|
node.isNameFirst = !!isNameFirst;
|
|
@@ -14993,7 +15261,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
14993
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;
|
|
14994
15262
|
}
|
|
14995
15263
|
function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
|
|
14996
|
-
const node =
|
|
15264
|
+
const node = createBaseJSDocTagDeclaration(351 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment);
|
|
14997
15265
|
node.typeExpression = typeExpression;
|
|
14998
15266
|
node.name = name;
|
|
14999
15267
|
node.isNameFirst = !!isNameFirst;
|
|
@@ -15004,15 +15272,25 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15004
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;
|
|
15005
15273
|
}
|
|
15006
15274
|
function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) {
|
|
15007
|
-
const node =
|
|
15275
|
+
const node = createBaseJSDocTagDeclaration(341 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment);
|
|
15008
15276
|
node.typeExpression = typeExpression;
|
|
15009
15277
|
node.fullName = fullName;
|
|
15010
15278
|
node.name = getJSDocTypeAliasName(fullName);
|
|
15279
|
+
node.locals = void 0;
|
|
15280
|
+
node.nextContainer = void 0;
|
|
15011
15281
|
return node;
|
|
15012
15282
|
}
|
|
15013
15283
|
function updateJSDocCallbackTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) {
|
|
15014
15284
|
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node;
|
|
15015
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
|
+
}
|
|
15016
15294
|
function createJSDocAugmentsTag(tagName, className, comment) {
|
|
15017
15295
|
const node = createBaseJSDocTag(331 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier("augments"), comment);
|
|
15018
15296
|
node.class = className;
|
|
@@ -15027,7 +15305,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15027
15305
|
return node;
|
|
15028
15306
|
}
|
|
15029
15307
|
function createJSDocSeeTag(tagName, name, comment) {
|
|
15030
|
-
const node = createBaseJSDocTag(
|
|
15308
|
+
const node = createBaseJSDocTag(350 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment);
|
|
15031
15309
|
node.name = name;
|
|
15032
15310
|
return node;
|
|
15033
15311
|
}
|
|
@@ -15104,6 +15382,16 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15104
15382
|
function updateJSDocUnknownTag(node, tagName, comment) {
|
|
15105
15383
|
return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node;
|
|
15106
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
|
+
}
|
|
15107
15395
|
function createJSDocText(text) {
|
|
15108
15396
|
const node = createBaseNode(324 /* JSDocText */);
|
|
15109
15397
|
node.text = text;
|
|
@@ -15201,7 +15489,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15201
15489
|
return node;
|
|
15202
15490
|
}
|
|
15203
15491
|
function createJsxAttribute(name, initializer) {
|
|
15204
|
-
const node =
|
|
15492
|
+
const node = createBaseDeclaration(288 /* JsxAttribute */);
|
|
15205
15493
|
node.name = name;
|
|
15206
15494
|
node.initializer = initializer;
|
|
15207
15495
|
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */;
|
|
@@ -15211,7 +15499,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15211
15499
|
return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node;
|
|
15212
15500
|
}
|
|
15213
15501
|
function createJsxAttributes(properties) {
|
|
15214
|
-
const node =
|
|
15502
|
+
const node = createBaseDeclaration(289 /* JsxAttributes */);
|
|
15215
15503
|
node.properties = createNodeArray(properties);
|
|
15216
15504
|
node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */;
|
|
15217
15505
|
return node;
|
|
@@ -15243,6 +15531,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15243
15531
|
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
|
|
15244
15532
|
node.statements = createNodeArray(statements);
|
|
15245
15533
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
|
|
15534
|
+
node.jsDoc = void 0;
|
|
15535
|
+
node.jsDocCache = void 0;
|
|
15246
15536
|
return node;
|
|
15247
15537
|
}
|
|
15248
15538
|
function updateCaseClause(node, expression, statements) {
|
|
@@ -15279,36 +15569,27 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15279
15569
|
}
|
|
15280
15570
|
function createCatchClause(variableDeclaration, block) {
|
|
15281
15571
|
const node = createBaseNode(295 /* CatchClause */);
|
|
15282
|
-
|
|
15283
|
-
variableDeclaration = createVariableDeclaration(
|
|
15284
|
-
variableDeclaration,
|
|
15285
|
-
void 0,
|
|
15286
|
-
void 0,
|
|
15287
|
-
void 0
|
|
15288
|
-
);
|
|
15289
|
-
}
|
|
15290
|
-
node.variableDeclaration = variableDeclaration;
|
|
15572
|
+
node.variableDeclaration = asVariableDeclaration(variableDeclaration);
|
|
15291
15573
|
node.block = block;
|
|
15292
|
-
node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block);
|
|
15293
|
-
|
|
15294
|
-
|
|
15574
|
+
node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block) | (!variableDeclaration ? 64 /* ContainsES2019 */ : 0 /* None */);
|
|
15575
|
+
node.locals = void 0;
|
|
15576
|
+
node.nextContainer = void 0;
|
|
15295
15577
|
return node;
|
|
15296
15578
|
}
|
|
15297
15579
|
function updateCatchClause(node, variableDeclaration, block) {
|
|
15298
15580
|
return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node;
|
|
15299
15581
|
}
|
|
15300
15582
|
function createPropertyAssignment(name, initializer) {
|
|
15301
|
-
const node =
|
|
15302
|
-
|
|
15303
|
-
void 0,
|
|
15304
|
-
name
|
|
15305
|
-
);
|
|
15583
|
+
const node = createBaseDeclaration(299 /* PropertyAssignment */);
|
|
15584
|
+
node.name = asName(name);
|
|
15306
15585
|
node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
|
|
15307
|
-
node.transformFlags |=
|
|
15586
|
+
node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer);
|
|
15308
15587
|
node.illegalDecorators = void 0;
|
|
15309
15588
|
node.modifiers = void 0;
|
|
15310
15589
|
node.questionToken = void 0;
|
|
15311
15590
|
node.exclamationToken = void 0;
|
|
15591
|
+
node.jsDoc = void 0;
|
|
15592
|
+
node.jsDocCache = void 0;
|
|
15312
15593
|
return node;
|
|
15313
15594
|
}
|
|
15314
15595
|
function updatePropertyAssignment(node, name, initializer) {
|
|
@@ -15324,18 +15605,17 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15324
15605
|
return update(updated, original);
|
|
15325
15606
|
}
|
|
15326
15607
|
function createShorthandPropertyAssignment(name, objectAssignmentInitializer) {
|
|
15327
|
-
const node =
|
|
15328
|
-
|
|
15329
|
-
void 0,
|
|
15330
|
-
name
|
|
15331
|
-
);
|
|
15608
|
+
const node = createBaseDeclaration(300 /* ShorthandPropertyAssignment */);
|
|
15609
|
+
node.name = asName(name);
|
|
15332
15610
|
node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer);
|
|
15333
|
-
node.transformFlags |= propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */;
|
|
15611
|
+
node.transformFlags |= propagateIdentifierNameFlags(node.name) | propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */;
|
|
15334
15612
|
node.equalsToken = void 0;
|
|
15335
15613
|
node.illegalDecorators = void 0;
|
|
15336
15614
|
node.modifiers = void 0;
|
|
15337
15615
|
node.questionToken = void 0;
|
|
15338
15616
|
node.exclamationToken = void 0;
|
|
15617
|
+
node.jsDoc = void 0;
|
|
15618
|
+
node.jsDocCache = void 0;
|
|
15339
15619
|
return node;
|
|
15340
15620
|
}
|
|
15341
15621
|
function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) {
|
|
@@ -15352,19 +15632,23 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15352
15632
|
return update(updated, original);
|
|
15353
15633
|
}
|
|
15354
15634
|
function createSpreadAssignment(expression) {
|
|
15355
|
-
const node =
|
|
15635
|
+
const node = createBaseDeclaration(301 /* SpreadAssignment */);
|
|
15356
15636
|
node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
|
|
15357
15637
|
node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
|
|
15638
|
+
node.jsDoc = void 0;
|
|
15639
|
+
node.jsDocCache = void 0;
|
|
15358
15640
|
return node;
|
|
15359
15641
|
}
|
|
15360
15642
|
function updateSpreadAssignment(node, expression) {
|
|
15361
15643
|
return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node;
|
|
15362
15644
|
}
|
|
15363
15645
|
function createEnumMember(name, initializer) {
|
|
15364
|
-
const node =
|
|
15646
|
+
const node = createBaseDeclaration(302 /* EnumMember */);
|
|
15365
15647
|
node.name = asName(name);
|
|
15366
15648
|
node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
|
|
15367
15649
|
node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
|
|
15650
|
+
node.jsDoc = void 0;
|
|
15651
|
+
node.jsDocCache = void 0;
|
|
15368
15652
|
return node;
|
|
15369
15653
|
}
|
|
15370
15654
|
function updateEnumMember(node, name, initializer) {
|
|
@@ -15375,33 +15659,111 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15375
15659
|
node.statements = createNodeArray(statements);
|
|
15376
15660
|
node.endOfFileToken = endOfFileToken;
|
|
15377
15661
|
node.flags |= flags2;
|
|
15378
|
-
node.fileName = "";
|
|
15379
15662
|
node.text = "";
|
|
15663
|
+
node.fileName = "";
|
|
15664
|
+
node.path = "";
|
|
15665
|
+
node.resolvedPath = "";
|
|
15666
|
+
node.originalFileName = "";
|
|
15380
15667
|
node.languageVersion = 0;
|
|
15381
15668
|
node.languageVariant = 0;
|
|
15382
15669
|
node.scriptKind = 0;
|
|
15383
15670
|
node.isDeclarationFile = false;
|
|
15384
15671
|
node.hasNoDefaultLib = false;
|
|
15385
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;
|
|
15386
15701
|
return node;
|
|
15387
15702
|
}
|
|
15388
|
-
function
|
|
15389
|
-
const node =
|
|
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 */;
|
|
15390
15741
|
for (const p in source) {
|
|
15391
|
-
if (
|
|
15742
|
+
if (hasProperty(node, p) || !hasProperty(source, p)) {
|
|
15743
|
+
continue;
|
|
15744
|
+
}
|
|
15745
|
+
if (p === "emitNode") {
|
|
15746
|
+
node.emitNode = void 0;
|
|
15392
15747
|
continue;
|
|
15748
|
+
}
|
|
15393
15749
|
node[p] = source[p];
|
|
15394
15750
|
}
|
|
15395
|
-
node
|
|
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);
|
|
15396
15760
|
node.statements = createNodeArray(statements);
|
|
15397
|
-
node.endOfFileToken = source.endOfFileToken;
|
|
15398
15761
|
node.isDeclarationFile = isDeclarationFile;
|
|
15399
15762
|
node.referencedFiles = referencedFiles;
|
|
15400
15763
|
node.typeReferenceDirectives = typeReferences;
|
|
15401
15764
|
node.hasNoDefaultLib = hasNoDefaultLib;
|
|
15402
15765
|
node.libReferenceDirectives = libReferences;
|
|
15403
15766
|
node.transformFlags = propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken);
|
|
15404
|
-
node.impliedNodeFormat = source.impliedNodeFormat;
|
|
15405
15767
|
return node;
|
|
15406
15768
|
}
|
|
15407
15769
|
function updateSourceFile(node, statements, isDeclarationFile = node.isDeclarationFile, referencedFiles = node.referencedFiles, typeReferenceDirectives = node.typeReferenceDirectives, hasNoDefaultLib = node.hasNoDefaultLib, libReferenceDirectives = node.libReferenceDirectives) {
|
|
@@ -15411,6 +15773,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15411
15773
|
const node = createBaseNode(309 /* Bundle */);
|
|
15412
15774
|
node.prepends = prepends;
|
|
15413
15775
|
node.sourceFiles = sourceFiles;
|
|
15776
|
+
node.syntheticFileReferences = void 0;
|
|
15777
|
+
node.syntheticTypeReferences = void 0;
|
|
15778
|
+
node.syntheticLibReferences = void 0;
|
|
15779
|
+
node.hasNoDefaultLib = void 0;
|
|
15414
15780
|
return node;
|
|
15415
15781
|
}
|
|
15416
15782
|
function updateBundle(node, sourceFiles, prepends = emptyArray) {
|
|
@@ -15464,18 +15830,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15464
15830
|
return node;
|
|
15465
15831
|
}
|
|
15466
15832
|
function createSyntaxList(children) {
|
|
15467
|
-
const node = createBaseNode(
|
|
15833
|
+
const node = createBaseNode(353 /* SyntaxList */);
|
|
15468
15834
|
node._children = children;
|
|
15469
15835
|
return node;
|
|
15470
15836
|
}
|
|
15471
15837
|
function createNotEmittedStatement(original) {
|
|
15472
|
-
const node = createBaseNode(
|
|
15838
|
+
const node = createBaseNode(354 /* NotEmittedStatement */);
|
|
15473
15839
|
node.original = original;
|
|
15474
15840
|
setTextRange(node, original);
|
|
15475
15841
|
return node;
|
|
15476
15842
|
}
|
|
15477
15843
|
function createPartiallyEmittedExpression(expression, original) {
|
|
15478
|
-
const node = createBaseNode(
|
|
15844
|
+
const node = createBaseNode(355 /* PartiallyEmittedExpression */);
|
|
15479
15845
|
node.expression = expression;
|
|
15480
15846
|
node.original = original;
|
|
15481
15847
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -15497,7 +15863,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15497
15863
|
return node;
|
|
15498
15864
|
}
|
|
15499
15865
|
function createCommaListExpression(elements) {
|
|
15500
|
-
const node = createBaseNode(
|
|
15866
|
+
const node = createBaseNode(356 /* CommaListExpression */);
|
|
15501
15867
|
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
|
|
15502
15868
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
15503
15869
|
return node;
|
|
@@ -15506,19 +15872,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15506
15872
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
15507
15873
|
}
|
|
15508
15874
|
function createEndOfDeclarationMarker(original) {
|
|
15509
|
-
const node = createBaseNode(
|
|
15875
|
+
const node = createBaseNode(358 /* EndOfDeclarationMarker */);
|
|
15510
15876
|
node.emitNode = {};
|
|
15511
15877
|
node.original = original;
|
|
15512
15878
|
return node;
|
|
15513
15879
|
}
|
|
15514
15880
|
function createMergeDeclarationMarker(original) {
|
|
15515
|
-
const node = createBaseNode(
|
|
15881
|
+
const node = createBaseNode(357 /* MergeDeclarationMarker */);
|
|
15516
15882
|
node.emitNode = {};
|
|
15517
15883
|
node.original = original;
|
|
15518
15884
|
return node;
|
|
15519
15885
|
}
|
|
15520
15886
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
15521
|
-
const node = createBaseNode(
|
|
15887
|
+
const node = createBaseNode(359 /* SyntheticReferenceExpression */);
|
|
15522
15888
|
node.expression = expression;
|
|
15523
15889
|
node.thisArg = thisArg;
|
|
15524
15890
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -15527,11 +15893,68 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15527
15893
|
function updateSyntheticReferenceExpression(node, expression, thisArg) {
|
|
15528
15894
|
return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node;
|
|
15529
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
|
+
}
|
|
15530
15938
|
function cloneNode(node) {
|
|
15531
15939
|
if (node === void 0) {
|
|
15532
15940
|
return node;
|
|
15533
15941
|
}
|
|
15534
|
-
|
|
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);
|
|
15535
15958
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
15536
15959
|
clone2.transformFlags = node.transformFlags;
|
|
15537
15960
|
setOriginalNode(clone2, node);
|
|
@@ -15666,7 +16089,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15666
16089
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
15667
16090
|
case 232 /* NonNullExpression */:
|
|
15668
16091
|
return updateNonNullExpression(outerExpression, expression);
|
|
15669
|
-
case
|
|
16092
|
+
case 355 /* PartiallyEmittedExpression */:
|
|
15670
16093
|
return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
15671
16094
|
}
|
|
15672
16095
|
}
|
|
@@ -15970,12 +16393,26 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
15970
16393
|
function asExpression(value) {
|
|
15971
16394
|
return typeof value === "string" ? createStringLiteral(value) : typeof value === "number" ? createNumericLiteral(value) : typeof value === "boolean" ? value ? createTrue() : createFalse() : value;
|
|
15972
16395
|
}
|
|
16396
|
+
function asInitializer(node) {
|
|
16397
|
+
return node && parenthesizerRules().parenthesizeExpressionForDisallowedComma(node);
|
|
16398
|
+
}
|
|
15973
16399
|
function asToken(value) {
|
|
15974
16400
|
return typeof value === "number" ? createToken(value) : value;
|
|
15975
16401
|
}
|
|
15976
16402
|
function asEmbeddedStatement(statement) {
|
|
15977
16403
|
return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement;
|
|
15978
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
|
+
}
|
|
15979
16416
|
}
|
|
15980
16417
|
function updateWithoutOriginal(updated, original) {
|
|
15981
16418
|
if (updated !== original) {
|
|
@@ -15992,13 +16429,13 @@ function updateWithOriginal(updated, original) {
|
|
|
15992
16429
|
}
|
|
15993
16430
|
function getDefaultTagNameForKind(kind) {
|
|
15994
16431
|
switch (kind) {
|
|
15995
|
-
case
|
|
16432
|
+
case 347 /* JSDocTypeTag */:
|
|
15996
16433
|
return "type";
|
|
15997
|
-
case
|
|
16434
|
+
case 345 /* JSDocReturnTag */:
|
|
15998
16435
|
return "returns";
|
|
15999
|
-
case
|
|
16436
|
+
case 346 /* JSDocThisTag */:
|
|
16000
16437
|
return "this";
|
|
16001
|
-
case
|
|
16438
|
+
case 343 /* JSDocEnumTag */:
|
|
16002
16439
|
return "enum";
|
|
16003
16440
|
case 333 /* JSDocAuthorTag */:
|
|
16004
16441
|
return "author";
|
|
@@ -16014,16 +16451,18 @@ function getDefaultTagNameForKind(kind) {
|
|
|
16014
16451
|
return "readonly";
|
|
16015
16452
|
case 340 /* JSDocOverrideTag */:
|
|
16016
16453
|
return "override";
|
|
16017
|
-
case
|
|
16454
|
+
case 348 /* JSDocTemplateTag */:
|
|
16018
16455
|
return "template";
|
|
16019
|
-
case
|
|
16456
|
+
case 349 /* JSDocTypedefTag */:
|
|
16020
16457
|
return "typedef";
|
|
16021
|
-
case
|
|
16458
|
+
case 344 /* JSDocParameterTag */:
|
|
16022
16459
|
return "param";
|
|
16023
|
-
case
|
|
16460
|
+
case 351 /* JSDocPropertyTag */:
|
|
16024
16461
|
return "prop";
|
|
16025
16462
|
case 341 /* JSDocCallbackTag */:
|
|
16026
16463
|
return "callback";
|
|
16464
|
+
case 342 /* JSDocOverloadTag */:
|
|
16465
|
+
return "overload";
|
|
16027
16466
|
case 331 /* JSDocAugmentsTag */:
|
|
16028
16467
|
return "augments";
|
|
16029
16468
|
case 332 /* JSDocImplementsTag */:
|
|
@@ -16076,6 +16515,9 @@ function getCookedText(kind, rawText) {
|
|
|
16076
16515
|
rawTextScanner.setText(void 0);
|
|
16077
16516
|
return tokenValue;
|
|
16078
16517
|
}
|
|
16518
|
+
function propagateNameFlags(node) {
|
|
16519
|
+
return node && isIdentifier(node) ? propagateIdentifierNameFlags(node) : propagateChildFlags(node);
|
|
16520
|
+
}
|
|
16079
16521
|
function propagateIdentifierNameFlags(node) {
|
|
16080
16522
|
return propagateChildFlags(node) & ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
16081
16523
|
}
|
|
@@ -16157,7 +16599,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
16157
16599
|
case 213 /* TypeAssertionExpression */:
|
|
16158
16600
|
case 235 /* SatisfiesExpression */:
|
|
16159
16601
|
case 231 /* AsExpression */:
|
|
16160
|
-
case
|
|
16602
|
+
case 355 /* PartiallyEmittedExpression */:
|
|
16161
16603
|
case 214 /* ParenthesizedExpression */:
|
|
16162
16604
|
case 106 /* SuperKeyword */:
|
|
16163
16605
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -16570,7 +17012,7 @@ function isMetaProperty(node) {
|
|
|
16570
17012
|
return node.kind === 233 /* MetaProperty */;
|
|
16571
17013
|
}
|
|
16572
17014
|
function isCommaListExpression(node) {
|
|
16573
|
-
return node.kind ===
|
|
17015
|
+
return node.kind === 356 /* CommaListExpression */;
|
|
16574
17016
|
}
|
|
16575
17017
|
function isTemplateSpan(node) {
|
|
16576
17018
|
return node.kind === 236 /* TemplateSpan */;
|
|
@@ -16651,7 +17093,7 @@ function isExportSpecifier(node) {
|
|
|
16651
17093
|
return node.kind === 278 /* ExportSpecifier */;
|
|
16652
17094
|
}
|
|
16653
17095
|
function isNotEmittedStatement(node) {
|
|
16654
|
-
return node.kind ===
|
|
17096
|
+
return node.kind === 354 /* NotEmittedStatement */;
|
|
16655
17097
|
}
|
|
16656
17098
|
function isExternalModuleReference(node) {
|
|
16657
17099
|
return node.kind === 280 /* ExternalModuleReference */;
|
|
@@ -16723,19 +17165,19 @@ function isJSDocDeprecatedTag(node) {
|
|
|
16723
17165
|
return node.kind === 334 /* JSDocDeprecatedTag */;
|
|
16724
17166
|
}
|
|
16725
17167
|
function isJSDocEnumTag(node) {
|
|
16726
|
-
return node.kind ===
|
|
17168
|
+
return node.kind === 343 /* JSDocEnumTag */;
|
|
16727
17169
|
}
|
|
16728
17170
|
function isJSDocParameterTag(node) {
|
|
16729
|
-
return node.kind ===
|
|
17171
|
+
return node.kind === 344 /* JSDocParameterTag */;
|
|
16730
17172
|
}
|
|
16731
17173
|
function isJSDocReturnTag(node) {
|
|
16732
|
-
return node.kind ===
|
|
17174
|
+
return node.kind === 345 /* JSDocReturnTag */;
|
|
16733
17175
|
}
|
|
16734
17176
|
function isJSDocTypeTag(node) {
|
|
16735
|
-
return node.kind ===
|
|
17177
|
+
return node.kind === 347 /* JSDocTypeTag */;
|
|
16736
17178
|
}
|
|
16737
17179
|
function isJSDocTemplateTag(node) {
|
|
16738
|
-
return node.kind ===
|
|
17180
|
+
return node.kind === 348 /* JSDocTemplateTag */;
|
|
16739
17181
|
}
|
|
16740
17182
|
|
|
16741
17183
|
// src/compiler/factory/utilities.ts
|
|
@@ -16758,7 +17200,7 @@ function findUseStrictPrologue(statements) {
|
|
|
16758
17200
|
return void 0;
|
|
16759
17201
|
}
|
|
16760
17202
|
function isCommaSequence(node) {
|
|
16761
|
-
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind ===
|
|
17203
|
+
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 356 /* CommaListExpression */;
|
|
16762
17204
|
}
|
|
16763
17205
|
function isJSDocTypeAssertion(node) {
|
|
16764
17206
|
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
|
|
@@ -16776,7 +17218,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
16776
17218
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
16777
17219
|
case 232 /* NonNullExpression */:
|
|
16778
17220
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
16779
|
-
case
|
|
17221
|
+
case 355 /* PartiallyEmittedExpression */:
|
|
16780
17222
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
16781
17223
|
}
|
|
16782
17224
|
return false;
|
|
@@ -17424,7 +17866,7 @@ var forEachChildTable = {
|
|
|
17424
17866
|
[279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
17425
17867
|
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
|
|
17426
17868
|
},
|
|
17427
|
-
[
|
|
17869
|
+
[356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
17428
17870
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
17429
17871
|
},
|
|
17430
17872
|
[281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -17463,7 +17905,7 @@ var forEachChildTable = {
|
|
|
17463
17905
|
[323 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) {
|
|
17464
17906
|
return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags);
|
|
17465
17907
|
},
|
|
17466
|
-
[
|
|
17908
|
+
[350 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) {
|
|
17467
17909
|
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
17468
17910
|
},
|
|
17469
17911
|
[313 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) {
|
|
@@ -17472,8 +17914,8 @@ var forEachChildTable = {
|
|
|
17472
17914
|
[314 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) {
|
|
17473
17915
|
return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right);
|
|
17474
17916
|
},
|
|
17475
|
-
[
|
|
17476
|
-
[
|
|
17917
|
+
[344 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag,
|
|
17918
|
+
[351 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag,
|
|
17477
17919
|
[333 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) {
|
|
17478
17920
|
return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
17479
17921
|
},
|
|
@@ -17483,20 +17925,20 @@ var forEachChildTable = {
|
|
|
17483
17925
|
[331 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) {
|
|
17484
17926
|
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
17485
17927
|
},
|
|
17486
|
-
[
|
|
17928
|
+
[348 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) {
|
|
17487
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));
|
|
17488
17930
|
},
|
|
17489
|
-
[
|
|
17931
|
+
[349 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) {
|
|
17490
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)));
|
|
17491
17933
|
},
|
|
17492
17934
|
[341 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
|
|
17493
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));
|
|
17494
17936
|
},
|
|
17495
|
-
[
|
|
17496
|
-
[
|
|
17497
|
-
[
|
|
17498
|
-
[
|
|
17499
|
-
[
|
|
17937
|
+
[345 /* JSDocReturnTag */]: forEachChildInJSDocTypeLikeTag,
|
|
17938
|
+
[347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag,
|
|
17939
|
+
[346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag,
|
|
17940
|
+
[343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag,
|
|
17941
|
+
[352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag,
|
|
17500
17942
|
[326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
|
|
17501
17943
|
return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
|
|
17502
17944
|
},
|
|
@@ -17514,7 +17956,7 @@ var forEachChildTable = {
|
|
|
17514
17956
|
[339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
17515
17957
|
[334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
17516
17958
|
[340 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
17517
|
-
[
|
|
17959
|
+
[355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
17518
17960
|
};
|
|
17519
17961
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
17520
17962
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -18734,7 +19176,7 @@ var Parser;
|
|
|
18734
19176
|
if (!canReuseNode(node, parsingContext2)) {
|
|
18735
19177
|
return void 0;
|
|
18736
19178
|
}
|
|
18737
|
-
if (node.jsDocCache) {
|
|
19179
|
+
if (canHaveJSDoc(node) && node.jsDocCache) {
|
|
18738
19180
|
node.jsDocCache = void 0;
|
|
18739
19181
|
}
|
|
18740
19182
|
return node;
|
|
@@ -22806,6 +23248,9 @@ var Parser;
|
|
|
22806
23248
|
case "callback":
|
|
22807
23249
|
tag = parseCallbackTag(start2, tagName, margin, indentText);
|
|
22808
23250
|
break;
|
|
23251
|
+
case "overload":
|
|
23252
|
+
tag = parseOverloadTag(start2, tagName, margin, indentText);
|
|
23253
|
+
break;
|
|
22809
23254
|
case "see":
|
|
22810
23255
|
tag = parseSeeTag(start2, tagName, margin, indentText);
|
|
22811
23256
|
break;
|
|
@@ -23034,7 +23479,7 @@ var Parser;
|
|
|
23034
23479
|
let child;
|
|
23035
23480
|
let children;
|
|
23036
23481
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
|
|
23037
|
-
if (child.kind ===
|
|
23482
|
+
if (child.kind === 344 /* JSDocParameterTag */ || child.kind === 351 /* JSDocPropertyTag */) {
|
|
23038
23483
|
children = append(children, child);
|
|
23039
23484
|
}
|
|
23040
23485
|
}
|
|
@@ -23157,7 +23602,7 @@ var Parser;
|
|
|
23157
23602
|
let hasChildren = false;
|
|
23158
23603
|
while (child = tryParse(() => parseChildPropertyTag(indent2))) {
|
|
23159
23604
|
hasChildren = true;
|
|
23160
|
-
if (child.kind ===
|
|
23605
|
+
if (child.kind === 347 /* JSDocTypeTag */) {
|
|
23161
23606
|
if (childTypeTag) {
|
|
23162
23607
|
const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
|
|
23163
23608
|
if (lastError) {
|
|
@@ -23215,26 +23660,39 @@ var Parser;
|
|
|
23215
23660
|
}
|
|
23216
23661
|
return createNodeArray(parameters || [], pos);
|
|
23217
23662
|
}
|
|
23218
|
-
function
|
|
23219
|
-
const fullName = parseJSDocTypeNameWithNamespace();
|
|
23220
|
-
skipWhitespace();
|
|
23221
|
-
let comment = parseTagComments(indent2);
|
|
23663
|
+
function parseJSDocSignature(start2, indent2) {
|
|
23222
23664
|
const parameters = parseCallbackTagParameters(indent2);
|
|
23223
23665
|
const returnTag = tryParse(() => {
|
|
23224
23666
|
if (parseOptionalJsdoc(59 /* AtToken */)) {
|
|
23225
23667
|
const tag = parseTag(indent2);
|
|
23226
|
-
if (tag && tag.kind ===
|
|
23668
|
+
if (tag && tag.kind === 345 /* JSDocReturnTag */) {
|
|
23227
23669
|
return tag;
|
|
23228
23670
|
}
|
|
23229
23671
|
}
|
|
23230
23672
|
});
|
|
23231
|
-
|
|
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);
|
|
23232
23680
|
if (!comment) {
|
|
23233
23681
|
comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
|
|
23234
23682
|
}
|
|
23235
23683
|
const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
|
|
23236
23684
|
return finishNode(factory2.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start2, end2);
|
|
23237
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
|
+
}
|
|
23238
23696
|
function escapedTextsEqual(a, b) {
|
|
23239
23697
|
while (!isIdentifier(a) || !isIdentifier(b)) {
|
|
23240
23698
|
if (!isIdentifier(a) && !isIdentifier(b) && a.right.escapedText === b.right.escapedText) {
|
|
@@ -23257,7 +23715,7 @@ var Parser;
|
|
|
23257
23715
|
case 59 /* AtToken */:
|
|
23258
23716
|
if (canParseTag) {
|
|
23259
23717
|
const child = tryParseChildTag(target, indent2);
|
|
23260
|
-
if (child && (child.kind ===
|
|
23718
|
+
if (child && (child.kind === 344 /* JSDocParameterTag */ || child.kind === 351 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
|
|
23261
23719
|
return false;
|
|
23262
23720
|
}
|
|
23263
23721
|
return child;
|
|
@@ -24717,7 +25175,8 @@ var commandOptionsWithoutBuild = [
|
|
|
24717
25175
|
node: 2 /* NodeJs */,
|
|
24718
25176
|
classic: 1 /* Classic */,
|
|
24719
25177
|
node16: 3 /* Node16 */,
|
|
24720
|
-
nodenext: 99 /* NodeNext
|
|
25178
|
+
nodenext: 99 /* NodeNext */,
|
|
25179
|
+
bundler: 100 /* Bundler */
|
|
24721
25180
|
})),
|
|
24722
25181
|
affectsModuleResolution: true,
|
|
24723
25182
|
paramType: Diagnostics.STRATEGY,
|
|
@@ -24830,6 +25289,41 @@ var commandOptionsWithoutBuild = [
|
|
|
24830
25289
|
category: Diagnostics.Modules,
|
|
24831
25290
|
description: Diagnostics.List_of_file_name_suffixes_to_search_when_resolving_a_module
|
|
24832
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
|
+
},
|
|
24833
25327
|
{
|
|
24834
25328
|
name: "sourceRoot",
|
|
24835
25329
|
type: "string",
|
|
@@ -25403,6 +25897,15 @@ var commandLineTypeAcquisitionMapCache;
|
|
|
25403
25897
|
function getCommandLineTypeAcquisitionMap() {
|
|
25404
25898
|
return commandLineTypeAcquisitionMapCache || (commandLineTypeAcquisitionMapCache = commandLineOptionsToMap(typeAcquisitionDeclarations));
|
|
25405
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
|
+
};
|
|
25406
25909
|
var _tsconfigRootOptions;
|
|
25407
25910
|
function getTsconfigRootOptionsMap() {
|
|
25408
25911
|
if (_tsconfigRootOptions === void 0) {
|
|
@@ -25434,11 +25937,7 @@ function getTsconfigRootOptionsMap() {
|
|
|
25434
25937
|
elementOptions: getCommandLineTypeAcquisitionMap(),
|
|
25435
25938
|
extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics
|
|
25436
25939
|
},
|
|
25437
|
-
|
|
25438
|
-
name: "extends",
|
|
25439
|
-
type: "string",
|
|
25440
|
-
category: Diagnostics.File_Management
|
|
25441
|
-
},
|
|
25940
|
+
extendsOptionDeclaration,
|
|
25442
25941
|
{
|
|
25443
25942
|
name: "references",
|
|
25444
25943
|
type: "list",
|
|
@@ -25573,10 +26072,10 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
25573
26072
|
let invalidReported;
|
|
25574
26073
|
switch (valueExpression.kind) {
|
|
25575
26074
|
case 110 /* TrueKeyword */:
|
|
25576
|
-
reportInvalidOptionValue(option && option.type !== "boolean");
|
|
26075
|
+
reportInvalidOptionValue(option && option.type !== "boolean" && (option.type !== "listOrElement" || option.element.type !== "boolean"));
|
|
25577
26076
|
return validateValue(true);
|
|
25578
26077
|
case 95 /* FalseKeyword */:
|
|
25579
|
-
reportInvalidOptionValue(option && option.type !== "boolean");
|
|
26078
|
+
reportInvalidOptionValue(option && option.type !== "boolean" && (option.type !== "listOrElement" || option.element.type !== "boolean"));
|
|
25580
26079
|
return validateValue(false);
|
|
25581
26080
|
case 104 /* NullKeyword */:
|
|
25582
26081
|
reportInvalidOptionValue(option && option.name === "extends");
|
|
@@ -25585,8 +26084,11 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
25585
26084
|
if (!isDoubleQuotedString(valueExpression)) {
|
|
25586
26085
|
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.String_literal_with_double_quotes_expected));
|
|
25587
26086
|
}
|
|
25588
|
-
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"));
|
|
25589
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
|
+
}
|
|
25590
26092
|
if (option && !isString(option.type)) {
|
|
25591
26093
|
const customOption = option;
|
|
25592
26094
|
if (!customOption.type.has(text.toLowerCase())) {
|
|
@@ -25601,16 +26103,16 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
25601
26103
|
}
|
|
25602
26104
|
return validateValue(text);
|
|
25603
26105
|
case 8 /* NumericLiteral */:
|
|
25604
|
-
reportInvalidOptionValue(option && option.type !== "number");
|
|
26106
|
+
reportInvalidOptionValue(option && option.type !== "number" && (option.type !== "listOrElement" || option.element.type !== "number"));
|
|
25605
26107
|
return validateValue(Number(valueExpression.text));
|
|
25606
26108
|
case 221 /* PrefixUnaryExpression */:
|
|
25607
26109
|
if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
|
|
25608
26110
|
break;
|
|
25609
26111
|
}
|
|
25610
|
-
reportInvalidOptionValue(option && option.type !== "number");
|
|
26112
|
+
reportInvalidOptionValue(option && option.type !== "number" && (option.type !== "listOrElement" || option.element.type !== "number"));
|
|
25611
26113
|
return validateValue(-Number(valueExpression.operand.text));
|
|
25612
26114
|
case 207 /* ObjectLiteralExpression */:
|
|
25613
|
-
reportInvalidOptionValue(option && option.type !== "object");
|
|
26115
|
+
reportInvalidOptionValue(option && option.type !== "object" && (option.type !== "listOrElement" || option.element.type !== "object"));
|
|
25614
26116
|
const objectLiteralExpression = valueExpression;
|
|
25615
26117
|
if (option) {
|
|
25616
26118
|
const { elementOptions, extraKeyDiagnostics, name: optionName } = option;
|
|
@@ -25629,7 +26131,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
25629
26131
|
));
|
|
25630
26132
|
}
|
|
25631
26133
|
case 206 /* ArrayLiteralExpression */:
|
|
25632
|
-
reportInvalidOptionValue(option && option.type !== "list");
|
|
26134
|
+
reportInvalidOptionValue(option && option.type !== "list" && option.type !== "listOrElement");
|
|
25633
26135
|
return validateValue(convertArrayLiteralExpressionToJson(
|
|
25634
26136
|
valueExpression.elements,
|
|
25635
26137
|
option && option.element
|
|
@@ -25664,7 +26166,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
25664
26166
|
}
|
|
25665
26167
|
}
|
|
25666
26168
|
function getCompilerOptionValueTypeString(option) {
|
|
25667
|
-
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";
|
|
25668
26170
|
}
|
|
25669
26171
|
function isCompilerOptionsValue(option, value) {
|
|
25670
26172
|
if (option) {
|
|
@@ -25673,6 +26175,9 @@ function isCompilerOptionsValue(option, value) {
|
|
|
25673
26175
|
if (option.type === "list") {
|
|
25674
26176
|
return isArray(value);
|
|
25675
26177
|
}
|
|
26178
|
+
if (option.type === "listOrElement") {
|
|
26179
|
+
return isArray(value) || isCompilerOptionsValue(option.element, value);
|
|
26180
|
+
}
|
|
25676
26181
|
const expectedType = isString(option.type) ? option.type : "string";
|
|
25677
26182
|
return typeof value === expectedType;
|
|
25678
26183
|
}
|
|
@@ -25734,7 +26239,7 @@ function withPackageId(packageInfo, r) {
|
|
|
25734
26239
|
};
|
|
25735
26240
|
}
|
|
25736
26241
|
}
|
|
25737
|
-
return r && { path: r.path, extension: r.ext, packageId };
|
|
26242
|
+
return r && { path: r.path, extension: r.ext, packageId, resolvedUsingTsExtension: r.resolvedUsingTsExtension };
|
|
25738
26243
|
}
|
|
25739
26244
|
function noPackageId(r) {
|
|
25740
26245
|
return withPackageId(void 0, r);
|
|
@@ -25742,7 +26247,7 @@ function noPackageId(r) {
|
|
|
25742
26247
|
function removeIgnoredPackageId(r) {
|
|
25743
26248
|
if (r) {
|
|
25744
26249
|
Debug.assert(r.packageId === void 0);
|
|
25745
|
-
return { path: r.path, ext: r.extension };
|
|
26250
|
+
return { path: r.path, ext: r.extension, resolvedUsingTsExtension: r.resolvedUsingTsExtension };
|
|
25746
26251
|
}
|
|
25747
26252
|
}
|
|
25748
26253
|
function formatExtensions(extensions) {
|
|
@@ -25765,7 +26270,14 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra
|
|
|
25765
26270
|
return resultFromCache;
|
|
25766
26271
|
}
|
|
25767
26272
|
return {
|
|
25768
|
-
resolvedModule: resolved && {
|
|
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
|
+
},
|
|
25769
26281
|
failedLookupLocations: initializeResolutionField(failedLookupLocations),
|
|
25770
26282
|
affectingLocations: initializeResolutionField(affectingLocations),
|
|
25771
26283
|
resolutionDiagnostics: initializeResolutionField(diagnostics)
|
|
@@ -25881,6 +26393,38 @@ function arePathsEqual(path1, path2, host) {
|
|
|
25881
26393
|
const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
|
25882
26394
|
return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */;
|
|
25883
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
|
+
}
|
|
25884
26428
|
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
25885
26429
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
25886
26430
|
if (redirectedReference) {
|
|
@@ -25937,6 +26481,9 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
25937
26481
|
case 1 /* Classic */:
|
|
25938
26482
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
25939
26483
|
break;
|
|
26484
|
+
case 100 /* Bundler */:
|
|
26485
|
+
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
26486
|
+
break;
|
|
25940
26487
|
default:
|
|
25941
26488
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
25942
26489
|
}
|
|
@@ -26066,6 +26613,19 @@ function resolveJSModule(moduleName, initialDir, host) {
|
|
|
26066
26613
|
}
|
|
26067
26614
|
return resolvedModule.resolvedFileName;
|
|
26068
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 || {});
|
|
26069
26629
|
function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
26070
26630
|
return nodeNextModuleNameResolverWorker(
|
|
26071
26631
|
30 /* Node16Default */,
|
|
@@ -26094,7 +26654,7 @@ function nodeNextModuleNameResolverWorker(features, moduleName, containingFile,
|
|
|
26094
26654
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
26095
26655
|
const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
|
|
26096
26656
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
26097
|
-
if (compilerOptions
|
|
26657
|
+
if (getResolveJsonModule(compilerOptions)) {
|
|
26098
26658
|
extensions |= 8 /* Json */;
|
|
26099
26659
|
}
|
|
26100
26660
|
return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, false, redirectedReference);
|
|
@@ -26112,16 +26672,24 @@ function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
|
26112
26672
|
void 0
|
|
26113
26673
|
);
|
|
26114
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
|
+
}
|
|
26115
26683
|
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
|
|
26116
26684
|
let extensions;
|
|
26117
26685
|
if (isConfigLookup) {
|
|
26118
26686
|
extensions = 8 /* Json */;
|
|
26119
26687
|
} else if (compilerOptions.noDtsResolution) {
|
|
26120
26688
|
extensions = 3 /* ImplementationFiles */;
|
|
26121
|
-
if (compilerOptions
|
|
26689
|
+
if (getResolveJsonModule(compilerOptions))
|
|
26122
26690
|
extensions |= 8 /* Json */;
|
|
26123
26691
|
} else {
|
|
26124
|
-
extensions = compilerOptions
|
|
26692
|
+
extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
26125
26693
|
}
|
|
26126
26694
|
return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
|
|
26127
26695
|
}
|
|
@@ -26130,10 +26698,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
26130
26698
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
26131
26699
|
const failedLookupLocations = [];
|
|
26132
26700
|
const affectingLocations = [];
|
|
26133
|
-
const conditions = features & 32 /* EsmMode */
|
|
26134
|
-
if (compilerOptions.noDtsResolution) {
|
|
26135
|
-
conditions.pop();
|
|
26136
|
-
}
|
|
26701
|
+
const conditions = getConditions(compilerOptions, !!(features & 32 /* EsmMode */));
|
|
26137
26702
|
const diagnostics = [];
|
|
26138
26703
|
const state = {
|
|
26139
26704
|
compilerOptions,
|
|
@@ -26294,7 +26859,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
|
26294
26859
|
}
|
|
26295
26860
|
}
|
|
26296
26861
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
26297
|
-
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)) {
|
|
26298
26863
|
const extensionless = removeFileExtension(candidate);
|
|
26299
26864
|
const extension = candidate.substring(extensionless.length);
|
|
26300
26865
|
if (state.traceEnabled) {
|
|
@@ -26306,7 +26871,7 @@ function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecor
|
|
|
26306
26871
|
function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) {
|
|
26307
26872
|
if (extensions & 1 /* TypeScript */ && fileExtensionIsOneOf(candidate, supportedTSImplementationExtensions) || extensions & 4 /* Declaration */ && fileExtensionIsOneOf(candidate, supportedDeclarationExtensions)) {
|
|
26308
26873
|
const result = tryFile(candidate, onlyRecordFailures, state);
|
|
26309
|
-
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;
|
|
26310
26875
|
}
|
|
26311
26876
|
return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
|
|
26312
26877
|
}
|
|
@@ -26341,12 +26906,18 @@ function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecor
|
|
|
26341
26906
|
return result;
|
|
26342
26907
|
}
|
|
26343
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
|
+
}
|
|
26344
26915
|
default:
|
|
26345
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;
|
|
26346
26917
|
}
|
|
26347
|
-
function tryExtension(ext) {
|
|
26918
|
+
function tryExtension(ext, resolvedUsingTsExtension) {
|
|
26348
26919
|
const path2 = tryFile(candidate + ext, onlyRecordFailures, state);
|
|
26349
|
-
return path2 === void 0 ? void 0 : { path: path2, ext };
|
|
26920
|
+
return path2 === void 0 ? void 0 : { path: path2, ext, resolvedUsingTsExtension };
|
|
26350
26921
|
}
|
|
26351
26922
|
}
|
|
26352
26923
|
function tryFile(fileName, onlyRecordFailures, state) {
|
|
@@ -26487,9 +27058,9 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
26487
27058
|
return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
|
|
26488
27059
|
}
|
|
26489
27060
|
}
|
|
26490
|
-
function resolvedIfExtensionMatches(extensions, path2) {
|
|
27061
|
+
function resolvedIfExtensionMatches(extensions, path2, resolvedUsingTsExtension) {
|
|
26491
27062
|
const ext = tryGetExtensionFromPath2(path2);
|
|
26492
|
-
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;
|
|
26493
27064
|
}
|
|
26494
27065
|
function extensionIsOk(extensions, extension) {
|
|
26495
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;
|
|
@@ -26655,7 +27226,13 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
26655
27226
|
traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup);
|
|
26656
27227
|
traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/");
|
|
26657
27228
|
const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, extensions, false, redirectedReference);
|
|
26658
|
-
return toSearchResult(result.resolvedModule ? {
|
|
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);
|
|
26659
27236
|
}
|
|
26660
27237
|
if (state.traceEnabled) {
|
|
26661
27238
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
@@ -26950,7 +27527,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
|
|
|
26950
27527
|
if (extension !== void 0) {
|
|
26951
27528
|
const path3 = tryFile(candidate, onlyRecordFailures, state);
|
|
26952
27529
|
if (path3 !== void 0) {
|
|
26953
|
-
return noPackageId({ path: path3, ext: extension });
|
|
27530
|
+
return noPackageId({ path: path3, ext: extension, resolvedUsingTsExtension: void 0 });
|
|
26954
27531
|
}
|
|
26955
27532
|
}
|
|
26956
27533
|
return loader(extensions, candidate, onlyRecordFailures || !directoryProbablyExists(getDirectoryPath(candidate), state.host), state);
|
|
@@ -26982,7 +27559,15 @@ function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containing
|
|
|
26982
27559
|
trace(state.host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
|
|
26983
27560
|
}
|
|
26984
27561
|
state.resultFromCache = result;
|
|
26985
|
-
return {
|
|
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
|
+
};
|
|
26986
27571
|
}
|
|
26987
27572
|
}
|
|
26988
27573
|
function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
|
|
@@ -27039,6 +27624,9 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
27039
27624
|
}
|
|
27040
27625
|
}
|
|
27041
27626
|
}
|
|
27627
|
+
function moduleResolutionSupportsResolvingTsExtensions(compilerOptions) {
|
|
27628
|
+
return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
|
|
27629
|
+
}
|
|
27042
27630
|
function toSearchResult(value) {
|
|
27043
27631
|
return value !== void 0 ? { value } : void 0;
|
|
27044
27632
|
}
|
|
@@ -27409,13 +27997,14 @@ function createBinder() {
|
|
|
27409
27997
|
if (node.kind === 278 /* ExportSpecifier */ || node.kind === 268 /* ImportEqualsDeclaration */ && hasExportModifier) {
|
|
27410
27998
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
27411
27999
|
} else {
|
|
28000
|
+
Debug.assertNode(container, canHaveLocals);
|
|
27412
28001
|
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
|
|
27413
28002
|
}
|
|
27414
28003
|
} else {
|
|
27415
28004
|
if (isJSDocTypeAlias(node))
|
|
27416
28005
|
Debug.assert(isInJSFile(node));
|
|
27417
28006
|
if (!isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) {
|
|
27418
|
-
if (!container.locals || hasSyntacticModifier(node, 1024 /* Default */) && !getDeclarationName(node)) {
|
|
28007
|
+
if (!canHaveLocals(container) || !container.locals || hasSyntacticModifier(node, 1024 /* Default */) && !getDeclarationName(node)) {
|
|
27419
28008
|
return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes);
|
|
27420
28009
|
}
|
|
27421
28010
|
const exportKind = symbolFlags & 111551 /* Value */ ? 1048576 /* ExportValue */ : 0;
|
|
@@ -27424,6 +28013,7 @@ function createBinder() {
|
|
|
27424
28013
|
node.localSymbol = local;
|
|
27425
28014
|
return local;
|
|
27426
28015
|
} else {
|
|
28016
|
+
Debug.assertNode(container, canHaveLocals);
|
|
27427
28017
|
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
|
|
27428
28018
|
}
|
|
27429
28019
|
}
|
|
@@ -27456,11 +28046,13 @@ function createBinder() {
|
|
|
27456
28046
|
container = blockScopeContainer = node;
|
|
27457
28047
|
if (containerFlags & 32 /* HasLocals */) {
|
|
27458
28048
|
container.locals = createSymbolTable();
|
|
28049
|
+
addToContainerChain(container);
|
|
27459
28050
|
}
|
|
27460
|
-
addToContainerChain(container);
|
|
27461
28051
|
} else if (containerFlags & 2 /* IsBlockScopedContainer */) {
|
|
27462
28052
|
blockScopeContainer = node;
|
|
27463
|
-
|
|
28053
|
+
if (containerFlags & 32 /* HasLocals */) {
|
|
28054
|
+
blockScopeContainer.locals = void 0;
|
|
28055
|
+
}
|
|
27464
28056
|
}
|
|
27465
28057
|
if (containerFlags & 4 /* IsControlFlowContainer */) {
|
|
27466
28058
|
const saveCurrentFlow = currentFlow;
|
|
@@ -27623,9 +28215,9 @@ function createBinder() {
|
|
|
27623
28215
|
case 232 /* NonNullExpression */:
|
|
27624
28216
|
bindNonNullExpressionFlow(node);
|
|
27625
28217
|
break;
|
|
27626
|
-
case
|
|
28218
|
+
case 349 /* JSDocTypedefTag */:
|
|
27627
28219
|
case 341 /* JSDocCallbackTag */:
|
|
27628
|
-
case
|
|
28220
|
+
case 343 /* JSDocEnumTag */:
|
|
27629
28221
|
bindJSDocTypeAlias(node);
|
|
27630
28222
|
break;
|
|
27631
28223
|
case 308 /* SourceFile */: {
|
|
@@ -28328,7 +28920,7 @@ function createBinder() {
|
|
|
28328
28920
|
}
|
|
28329
28921
|
function bindJSDocTypeAlias(node) {
|
|
28330
28922
|
bind(node.tagName);
|
|
28331
|
-
if (node.kind !==
|
|
28923
|
+
if (node.kind !== 343 /* JSDocEnumTag */ && node.fullName) {
|
|
28332
28924
|
setParent(node.fullName, node);
|
|
28333
28925
|
setParentRecursive(node.fullName, false);
|
|
28334
28926
|
}
|
|
@@ -28425,60 +29017,6 @@ function createBinder() {
|
|
|
28425
29017
|
}
|
|
28426
29018
|
}
|
|
28427
29019
|
}
|
|
28428
|
-
function getContainerFlags(node) {
|
|
28429
|
-
switch (node.kind) {
|
|
28430
|
-
case 228 /* ClassExpression */:
|
|
28431
|
-
case 260 /* ClassDeclaration */:
|
|
28432
|
-
case 263 /* EnumDeclaration */:
|
|
28433
|
-
case 207 /* ObjectLiteralExpression */:
|
|
28434
|
-
case 184 /* TypeLiteral */:
|
|
28435
|
-
case 325 /* JSDocTypeLiteral */:
|
|
28436
|
-
case 289 /* JsxAttributes */:
|
|
28437
|
-
return 1 /* IsContainer */;
|
|
28438
|
-
case 261 /* InterfaceDeclaration */:
|
|
28439
|
-
return 1 /* IsContainer */ | 64 /* IsInterface */;
|
|
28440
|
-
case 264 /* ModuleDeclaration */:
|
|
28441
|
-
case 262 /* TypeAliasDeclaration */:
|
|
28442
|
-
case 197 /* MappedType */:
|
|
28443
|
-
case 178 /* IndexSignature */:
|
|
28444
|
-
return 1 /* IsContainer */ | 32 /* HasLocals */;
|
|
28445
|
-
case 308 /* SourceFile */:
|
|
28446
|
-
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
|
|
28447
|
-
case 174 /* GetAccessor */:
|
|
28448
|
-
case 175 /* SetAccessor */:
|
|
28449
|
-
case 171 /* MethodDeclaration */:
|
|
28450
|
-
if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
|
|
28451
|
-
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
|
|
28452
|
-
}
|
|
28453
|
-
case 173 /* Constructor */:
|
|
28454
|
-
case 259 /* FunctionDeclaration */:
|
|
28455
|
-
case 170 /* MethodSignature */:
|
|
28456
|
-
case 176 /* CallSignature */:
|
|
28457
|
-
case 326 /* JSDocSignature */:
|
|
28458
|
-
case 320 /* JSDocFunctionType */:
|
|
28459
|
-
case 181 /* FunctionType */:
|
|
28460
|
-
case 177 /* ConstructSignature */:
|
|
28461
|
-
case 182 /* ConstructorType */:
|
|
28462
|
-
case 172 /* ClassStaticBlockDeclaration */:
|
|
28463
|
-
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
|
|
28464
|
-
case 215 /* FunctionExpression */:
|
|
28465
|
-
case 216 /* ArrowFunction */:
|
|
28466
|
-
return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
|
|
28467
|
-
case 265 /* ModuleBlock */:
|
|
28468
|
-
return 4 /* IsControlFlowContainer */;
|
|
28469
|
-
case 169 /* PropertyDeclaration */:
|
|
28470
|
-
return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
|
|
28471
|
-
case 295 /* CatchClause */:
|
|
28472
|
-
case 245 /* ForStatement */:
|
|
28473
|
-
case 246 /* ForInStatement */:
|
|
28474
|
-
case 247 /* ForOfStatement */:
|
|
28475
|
-
case 266 /* CaseBlock */:
|
|
28476
|
-
return 2 /* IsBlockScopedContainer */;
|
|
28477
|
-
case 238 /* Block */:
|
|
28478
|
-
return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */;
|
|
28479
|
-
}
|
|
28480
|
-
return 0 /* None */;
|
|
28481
|
-
}
|
|
28482
29020
|
function addToContainerChain(next) {
|
|
28483
29021
|
if (lastContainer) {
|
|
28484
29022
|
lastContainer.nextContainer = next;
|
|
@@ -28517,11 +29055,11 @@ function createBinder() {
|
|
|
28517
29055
|
case 215 /* FunctionExpression */:
|
|
28518
29056
|
case 216 /* ArrowFunction */:
|
|
28519
29057
|
case 320 /* JSDocFunctionType */:
|
|
28520
|
-
case 348 /* JSDocTypedefTag */:
|
|
28521
|
-
case 341 /* JSDocCallbackTag */:
|
|
28522
29058
|
case 172 /* ClassStaticBlockDeclaration */:
|
|
28523
29059
|
case 262 /* TypeAliasDeclaration */:
|
|
28524
29060
|
case 197 /* MappedType */:
|
|
29061
|
+
if (container.locals)
|
|
29062
|
+
Debug.assertNode(container, canHaveLocals);
|
|
28525
29063
|
return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes);
|
|
28526
29064
|
}
|
|
28527
29065
|
}
|
|
@@ -28616,6 +29154,7 @@ function createBinder() {
|
|
|
28616
29154
|
break;
|
|
28617
29155
|
}
|
|
28618
29156
|
default:
|
|
29157
|
+
Debug.assertNode(blockScopeContainer, canHaveLocals);
|
|
28619
29158
|
if (!blockScopeContainer.locals) {
|
|
28620
29159
|
blockScopeContainer.locals = createSymbolTable();
|
|
28621
29160
|
addToContainerChain(blockScopeContainer);
|
|
@@ -29125,21 +29664,23 @@ function createBinder() {
|
|
|
29125
29664
|
}
|
|
29126
29665
|
case 265 /* ModuleBlock */:
|
|
29127
29666
|
return updateStrictModeStatementList(node.statements);
|
|
29128
|
-
case
|
|
29667
|
+
case 344 /* JSDocParameterTag */:
|
|
29129
29668
|
if (node.parent.kind === 326 /* JSDocSignature */) {
|
|
29130
29669
|
return bindParameter(node);
|
|
29131
29670
|
}
|
|
29132
29671
|
if (node.parent.kind !== 325 /* JSDocTypeLiteral */) {
|
|
29133
29672
|
break;
|
|
29134
29673
|
}
|
|
29135
|
-
case
|
|
29674
|
+
case 351 /* JSDocPropertyTag */:
|
|
29136
29675
|
const propTag = node;
|
|
29137
29676
|
const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 319 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
|
|
29138
29677
|
return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */);
|
|
29139
|
-
case
|
|
29678
|
+
case 349 /* JSDocTypedefTag */:
|
|
29140
29679
|
case 341 /* JSDocCallbackTag */:
|
|
29141
|
-
case
|
|
29680
|
+
case 343 /* JSDocEnumTag */:
|
|
29142
29681
|
return (delayedTypeAliases || (delayedTypeAliases = [])).push(node);
|
|
29682
|
+
case 342 /* JSDocOverloadTag */:
|
|
29683
|
+
return bind(node.typeExpression);
|
|
29143
29684
|
}
|
|
29144
29685
|
}
|
|
29145
29686
|
function bindPropertyWorker(node) {
|
|
@@ -29272,7 +29813,7 @@ function createBinder() {
|
|
|
29272
29813
|
if (hasPrivateIdentifier) {
|
|
29273
29814
|
return;
|
|
29274
29815
|
}
|
|
29275
|
-
const thisContainer = getThisContainer(node, false);
|
|
29816
|
+
const thisContainer = getThisContainer(node, false, false);
|
|
29276
29817
|
switch (thisContainer.kind) {
|
|
29277
29818
|
case 259 /* FunctionDeclaration */:
|
|
29278
29819
|
case 215 /* FunctionExpression */:
|
|
@@ -29536,7 +30077,7 @@ function createBinder() {
|
|
|
29536
30077
|
}
|
|
29537
30078
|
if (!isBindingPattern(node.name)) {
|
|
29538
30079
|
const possibleVariableDecl = node.kind === 257 /* VariableDeclaration */ ? node : node.parent.parent;
|
|
29539
|
-
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 */)) {
|
|
29540
30081
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
29541
30082
|
} else if (isBlockOrCatchScoped(node)) {
|
|
29542
30083
|
bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */);
|
|
@@ -29548,7 +30089,7 @@ function createBinder() {
|
|
|
29548
30089
|
}
|
|
29549
30090
|
}
|
|
29550
30091
|
function bindParameter(node) {
|
|
29551
|
-
if (node.kind ===
|
|
30092
|
+
if (node.kind === 344 /* JSDocParameterTag */ && container.kind !== 326 /* JSDocSignature */) {
|
|
29552
30093
|
return;
|
|
29553
30094
|
}
|
|
29554
30095
|
if (inStrictMode && !(node.flags & 16777216 /* Ambient */)) {
|
|
@@ -29605,12 +30146,12 @@ function createBinder() {
|
|
|
29605
30146
|
return extendsType && extendsType.parent;
|
|
29606
30147
|
}
|
|
29607
30148
|
function bindTypeParameter(node) {
|
|
30149
|
+
var _a2, _b;
|
|
29608
30150
|
if (isJSDocTemplateTag(node.parent)) {
|
|
29609
30151
|
const container2 = getEffectiveContainerForJSDocTemplateTag(node.parent);
|
|
29610
30152
|
if (container2) {
|
|
29611
|
-
|
|
29612
|
-
|
|
29613
|
-
}
|
|
30153
|
+
Debug.assertNode(container2, canHaveLocals);
|
|
30154
|
+
(_a2 = container2.locals) != null ? _a2 : container2.locals = createSymbolTable();
|
|
29614
30155
|
declareSymbol(container2.locals, void 0, node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
|
|
29615
30156
|
} else {
|
|
29616
30157
|
declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
|
|
@@ -29618,9 +30159,8 @@ function createBinder() {
|
|
|
29618
30159
|
} else if (node.parent.kind === 192 /* InferType */) {
|
|
29619
30160
|
const container2 = getInferTypeContainer(node.parent);
|
|
29620
30161
|
if (container2) {
|
|
29621
|
-
|
|
29622
|
-
|
|
29623
|
-
}
|
|
30162
|
+
Debug.assertNode(container2, canHaveLocals);
|
|
30163
|
+
(_b = container2.locals) != null ? _b : container2.locals = createSymbolTable();
|
|
29624
30164
|
declareSymbol(container2.locals, void 0, node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */);
|
|
29625
30165
|
} else {
|
|
29626
30166
|
bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node));
|
|
@@ -29698,15 +30238,72 @@ function isExportsOrModuleExportsOrAlias(sourceFile, node) {
|
|
|
29698
30238
|
}
|
|
29699
30239
|
return false;
|
|
29700
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
|
+
}
|
|
29701
30295
|
function lookupSymbolForName(container, name) {
|
|
29702
|
-
|
|
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);
|
|
29703
30298
|
if (local) {
|
|
29704
|
-
return local.exportSymbol
|
|
30299
|
+
return (_c = local.exportSymbol) != null ? _c : local;
|
|
29705
30300
|
}
|
|
29706
30301
|
if (isSourceFile(container) && container.jsGlobalAugmentations && container.jsGlobalAugmentations.has(name)) {
|
|
29707
30302
|
return container.jsGlobalAugmentations.get(name);
|
|
29708
30303
|
}
|
|
29709
|
-
|
|
30304
|
+
if (canHaveSymbol(container)) {
|
|
30305
|
+
return (_e = (_d = container.symbol) == null ? void 0 : _d.exports) == null ? void 0 : _e.get(name);
|
|
30306
|
+
}
|
|
29710
30307
|
}
|
|
29711
30308
|
|
|
29712
30309
|
// src/compiler/checker.ts
|
|
@@ -31083,13 +31680,13 @@ var visitEachChildTable = {
|
|
|
31083
31680
|
visitLexicalEnvironment(node.statements, visitor, context)
|
|
31084
31681
|
);
|
|
31085
31682
|
},
|
|
31086
|
-
[
|
|
31683
|
+
[355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
31087
31684
|
return context.factory.updatePartiallyEmittedExpression(
|
|
31088
31685
|
node,
|
|
31089
31686
|
nodeVisitor(node.expression, visitor, isExpression)
|
|
31090
31687
|
);
|
|
31091
31688
|
},
|
|
31092
|
-
[
|
|
31689
|
+
[356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
31093
31690
|
return context.factory.updateCommaListExpression(
|
|
31094
31691
|
node,
|
|
31095
31692
|
nodesVisitor(node.elements, visitor, isExpression)
|