typescript 5.0.0-dev.20221215 → 5.0.0-dev.20221216
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 +248 -172
- package/lib/tsserver.js +295 -207
- package/lib/tsserverlibrary.d.ts +2 -3
- package/lib/tsserverlibrary.js +296 -209
- package/lib/typescript.d.ts +2 -3
- package/lib/typescript.js +294 -208
- package/lib/typingsInstaller.js +58 -40
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -62,6 +62,7 @@ __export(server_exports, {
|
|
|
62
62
|
ContextFlags: () => ContextFlags,
|
|
63
63
|
CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
|
|
64
64
|
Debug: () => Debug,
|
|
65
|
+
DeprecationVersion: () => DeprecationVersion,
|
|
65
66
|
DiagnosticCategory: () => DiagnosticCategory,
|
|
66
67
|
Diagnostics: () => Diagnostics,
|
|
67
68
|
DocumentHighlights: () => DocumentHighlights,
|
|
@@ -2668,7 +2669,7 @@ __export(ts_server_exports3, {
|
|
|
2668
2669
|
|
|
2669
2670
|
// src/compiler/corePublic.ts
|
|
2670
2671
|
var versionMajorMinor = "5.0";
|
|
2671
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2672
|
+
var version = `${versionMajorMinor}.0-dev.20221216`;
|
|
2672
2673
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2673
2674
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2674
2675
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6628,18 +6629,18 @@ var RelationComparisonResult = /* @__PURE__ */ ((RelationComparisonResult3) => {
|
|
|
6628
6629
|
RelationComparisonResult3[RelationComparisonResult3["ReportsMask"] = 24] = "ReportsMask";
|
|
6629
6630
|
return RelationComparisonResult3;
|
|
6630
6631
|
})(RelationComparisonResult || {});
|
|
6631
|
-
var GeneratedIdentifierFlags = /* @__PURE__ */ ((
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
return
|
|
6632
|
+
var GeneratedIdentifierFlags = /* @__PURE__ */ ((GeneratedIdentifierFlags2) => {
|
|
6633
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["None"] = 0] = "None";
|
|
6634
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Auto"] = 1] = "Auto";
|
|
6635
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Loop"] = 2] = "Loop";
|
|
6636
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Unique"] = 3] = "Unique";
|
|
6637
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Node"] = 4] = "Node";
|
|
6638
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["KindMask"] = 7] = "KindMask";
|
|
6639
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes";
|
|
6640
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Optimistic"] = 16] = "Optimistic";
|
|
6641
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["FileLevel"] = 32] = "FileLevel";
|
|
6642
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution";
|
|
6643
|
+
return GeneratedIdentifierFlags2;
|
|
6643
6644
|
})(GeneratedIdentifierFlags || {});
|
|
6644
6645
|
var TokenFlags = /* @__PURE__ */ ((TokenFlags2) => {
|
|
6645
6646
|
TokenFlags2[TokenFlags2["None"] = 0] = "None";
|
|
@@ -7245,7 +7246,7 @@ function diagnosticCategoryName(d, lowerCase = true) {
|
|
|
7245
7246
|
}
|
|
7246
7247
|
var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind3) => {
|
|
7247
7248
|
ModuleResolutionKind3[ModuleResolutionKind3["Classic"] = 1] = "Classic";
|
|
7248
|
-
ModuleResolutionKind3[ModuleResolutionKind3["
|
|
7249
|
+
ModuleResolutionKind3[ModuleResolutionKind3["Node10"] = 2] = "Node10";
|
|
7249
7250
|
ModuleResolutionKind3[ModuleResolutionKind3["Node16"] = 3] = "Node16";
|
|
7250
7251
|
ModuleResolutionKind3[ModuleResolutionKind3["NodeNext"] = 99] = "NodeNext";
|
|
7251
7252
|
ModuleResolutionKind3[ModuleResolutionKind3["Bundler"] = 100] = "Bundler";
|
|
@@ -7801,6 +7802,12 @@ var commentPragmas = {
|
|
|
7801
7802
|
kind: 4 /* MultiLine */
|
|
7802
7803
|
}
|
|
7803
7804
|
};
|
|
7805
|
+
var DeprecationVersion = /* @__PURE__ */ ((DeprecationVersion2) => {
|
|
7806
|
+
DeprecationVersion2["v5_0"] = "5.0";
|
|
7807
|
+
DeprecationVersion2["v5_5"] = "5.5";
|
|
7808
|
+
DeprecationVersion2["v6_0"] = "6.0";
|
|
7809
|
+
return DeprecationVersion2;
|
|
7810
|
+
})(DeprecationVersion || {});
|
|
7804
7811
|
|
|
7805
7812
|
// src/compiler/sys.ts
|
|
7806
7813
|
function generateDjb2Hash(data) {
|
|
@@ -10365,7 +10372,7 @@ var Diagnostics = {
|
|
|
10365
10372
|
Its_element_type_0_is_not_a_valid_JSX_element: diag(2789, 1 /* Error */, "Its_element_type_0_is_not_a_valid_JSX_element_2789", "Its element type '{0}' is not a valid JSX element."),
|
|
10366
10373
|
The_operand_of_a_delete_operator_must_be_optional: diag(2790, 1 /* Error */, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."),
|
|
10367
10374
|
Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, 1 /* Error */, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),
|
|
10368
|
-
|
|
10375
|
+
Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option: diag(2792, 1 /* Error */, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'nodenext', or to add aliases to the 'paths' option?"),
|
|
10369
10376
|
The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, 1 /* Error */, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),
|
|
10370
10377
|
Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, 1 /* Error */, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),
|
|
10371
10378
|
The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, 1 /* Error */, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),
|
|
@@ -10547,7 +10554,7 @@ var Diagnostics = {
|
|
|
10547
10554
|
Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(5067, 1 /* Error */, "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067", "Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),
|
|
10548
10555
|
Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(5068, 1 /* Error */, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),
|
|
10549
10556
|
Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: diag(5069, 1 /* Error */, "Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069", "Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),
|
|
10550
|
-
|
|
10557
|
+
Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic: diag(5070, 1 /* Error */, "Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic_5070", "Option '--resolveJsonModule' cannot be specified when 'moduleResolution' is set to 'classic'."),
|
|
10551
10558
|
Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext: diag(5071, 1 /* Error */, "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071", "Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),
|
|
10552
10559
|
Unknown_build_option_0: diag(5072, 1 /* Error */, "Unknown_build_option_0_5072", "Unknown build option '{0}'."),
|
|
10553
10560
|
Build_option_0_requires_a_value_of_type_1: diag(5073, 1 /* Error */, "Build_option_0_requires_a_value_of_type_1_5073", "Build option '{0}' requires a value of type {1}."),
|
|
@@ -10578,6 +10585,9 @@ var Diagnostics = {
|
|
|
10578
10585
|
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'."),
|
|
10579
10586
|
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.`),
|
|
10580
10587
|
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."),
|
|
10588
|
+
Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify 'ignoreDeprecations: "{2}"' to silence this error.`),
|
|
10589
|
+
Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."),
|
|
10590
|
+
Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."),
|
|
10581
10591
|
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."),
|
|
10582
10592
|
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."),
|
|
10583
10593
|
Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
|
|
@@ -14175,10 +14185,10 @@ function isStringTextContainingNode(node) {
|
|
|
14175
14185
|
return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
|
|
14176
14186
|
}
|
|
14177
14187
|
function isGeneratedIdentifier(node) {
|
|
14178
|
-
return isIdentifier(node) &&
|
|
14188
|
+
return isIdentifier(node) && node.autoGenerate !== void 0;
|
|
14179
14189
|
}
|
|
14180
14190
|
function isGeneratedPrivateIdentifier(node) {
|
|
14181
|
-
return isPrivateIdentifier(node) &&
|
|
14191
|
+
return isPrivateIdentifier(node) && node.autoGenerate !== void 0;
|
|
14182
14192
|
}
|
|
14183
14193
|
function isPrivateIdentifierClassElementDeclaration(node) {
|
|
14184
14194
|
return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name);
|
|
@@ -15553,7 +15563,7 @@ function tryGetTextOfPropertyName(name) {
|
|
|
15553
15563
|
switch (name.kind) {
|
|
15554
15564
|
case 79 /* Identifier */:
|
|
15555
15565
|
case 80 /* PrivateIdentifier */:
|
|
15556
|
-
return name.
|
|
15566
|
+
return name.autoGenerate ? void 0 : name.escapedText;
|
|
15557
15567
|
case 10 /* StringLiteral */:
|
|
15558
15568
|
case 8 /* NumericLiteral */:
|
|
15559
15569
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
@@ -18834,7 +18844,7 @@ function closeFileWatcher(watcher) {
|
|
|
18834
18844
|
watcher.close();
|
|
18835
18845
|
}
|
|
18836
18846
|
function getCheckFlags(symbol) {
|
|
18837
|
-
return symbol.flags & 33554432 /* Transient */ ? symbol.checkFlags : 0;
|
|
18847
|
+
return symbol.flags & 33554432 /* Transient */ ? symbol.links.checkFlags : 0;
|
|
18838
18848
|
}
|
|
18839
18849
|
function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
18840
18850
|
if (s.valueDeclaration) {
|
|
@@ -18843,7 +18853,7 @@ function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
|
18843
18853
|
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~28 /* AccessibilityModifier */;
|
|
18844
18854
|
}
|
|
18845
18855
|
if (getCheckFlags(s) & 6 /* Synthetic */) {
|
|
18846
|
-
const checkFlags = s.checkFlags;
|
|
18856
|
+
const checkFlags = s.links.checkFlags;
|
|
18847
18857
|
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 8 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 4 /* Public */ : 16 /* Protected */;
|
|
18848
18858
|
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 32 /* Static */ : 0;
|
|
18849
18859
|
return accessModifier | staticModifier;
|
|
@@ -19107,9 +19117,16 @@ function Symbol4(flags, name) {
|
|
|
19107
19117
|
this.escapedName = name;
|
|
19108
19118
|
this.declarations = void 0;
|
|
19109
19119
|
this.valueDeclaration = void 0;
|
|
19110
|
-
this.id =
|
|
19111
|
-
this.mergeId =
|
|
19120
|
+
this.id = 0;
|
|
19121
|
+
this.mergeId = 0;
|
|
19112
19122
|
this.parent = void 0;
|
|
19123
|
+
this.members = void 0;
|
|
19124
|
+
this.exports = void 0;
|
|
19125
|
+
this.exportSymbol = void 0;
|
|
19126
|
+
this.constEnumOnlyModule = void 0;
|
|
19127
|
+
this.isReferenced = void 0;
|
|
19128
|
+
this.isAssigned = void 0;
|
|
19129
|
+
this.links = void 0;
|
|
19113
19130
|
}
|
|
19114
19131
|
function Type3(checker, flags) {
|
|
19115
19132
|
this.flags = flags;
|
|
@@ -19423,7 +19440,7 @@ function getEmitModuleResolutionKind(compilerOptions) {
|
|
|
19423
19440
|
if (moduleResolution === void 0) {
|
|
19424
19441
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
19425
19442
|
case 1 /* CommonJS */:
|
|
19426
|
-
moduleResolution = 2 /*
|
|
19443
|
+
moduleResolution = 2 /* Node10 */;
|
|
19427
19444
|
break;
|
|
19428
19445
|
case 100 /* Node16 */:
|
|
19429
19446
|
moduleResolution = 3 /* Node16 */;
|
|
@@ -21803,15 +21820,23 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21803
21820
|
const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
|
|
21804
21821
|
node.originalKeywordKind = originalKeywordKind;
|
|
21805
21822
|
node.escapedText = escapedText;
|
|
21806
|
-
node.
|
|
21823
|
+
node.autoGenerate = void 0;
|
|
21824
|
+
node.typeArguments = void 0;
|
|
21825
|
+
node.hasExtendedUnicodeEscape = void 0;
|
|
21826
|
+
node.jsDoc = void 0;
|
|
21827
|
+
node.jsDocCache = void 0;
|
|
21828
|
+
node.flowNode = void 0;
|
|
21829
|
+
node.symbol = void 0;
|
|
21807
21830
|
return node;
|
|
21808
21831
|
}
|
|
21809
21832
|
function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
21810
21833
|
const node = createBaseIdentifier(escapeLeadingUnderscores(text), void 0);
|
|
21811
|
-
node.
|
|
21812
|
-
|
|
21813
|
-
|
|
21814
|
-
|
|
21834
|
+
node.autoGenerate = {
|
|
21835
|
+
flags: autoGenerateFlags,
|
|
21836
|
+
id: nextAutoGenerateId,
|
|
21837
|
+
prefix,
|
|
21838
|
+
suffix
|
|
21839
|
+
};
|
|
21815
21840
|
nextAutoGenerateId++;
|
|
21816
21841
|
return node;
|
|
21817
21842
|
}
|
|
@@ -21825,10 +21850,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21825
21850
|
const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind);
|
|
21826
21851
|
node.typeArguments = asNodeArray(typeArguments);
|
|
21827
21852
|
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
21828
|
-
node.jsDoc = void 0;
|
|
21829
|
-
node.jsDocCache = void 0;
|
|
21830
|
-
node.flowNode = void 0;
|
|
21831
|
-
node.symbol = void 0;
|
|
21832
21853
|
if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
|
|
21833
21854
|
node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
|
|
21834
21855
|
}
|
|
@@ -21873,7 +21894,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21873
21894
|
function createBasePrivateIdentifier(escapedText) {
|
|
21874
21895
|
const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
|
|
21875
21896
|
node.escapedText = escapedText;
|
|
21876
|
-
node.
|
|
21897
|
+
node.autoGenerate = void 0;
|
|
21877
21898
|
node.transformFlags |= 16777216 /* ContainsClassFields */;
|
|
21878
21899
|
return node;
|
|
21879
21900
|
}
|
|
@@ -21884,10 +21905,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21884
21905
|
}
|
|
21885
21906
|
function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
21886
21907
|
const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
|
|
21887
|
-
node.
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
|
|
21908
|
+
node.autoGenerate = {
|
|
21909
|
+
flags: autoGenerateFlags,
|
|
21910
|
+
id: nextAutoGenerateId,
|
|
21911
|
+
prefix,
|
|
21912
|
+
suffix
|
|
21913
|
+
};
|
|
21891
21914
|
nextAutoGenerateId++;
|
|
21892
21915
|
return node;
|
|
21893
21916
|
}
|
|
@@ -24680,10 +24703,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24680
24703
|
function cloneGeneratedIdentifier(node) {
|
|
24681
24704
|
const clone2 = createBaseIdentifier(node.escapedText, void 0);
|
|
24682
24705
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
24683
|
-
clone2.
|
|
24684
|
-
clone2.autoGenerateId = node.autoGenerateId;
|
|
24685
|
-
clone2.autoGeneratePrefix = node.autoGeneratePrefix;
|
|
24686
|
-
clone2.autoGenerateSuffix = node.autoGenerateSuffix;
|
|
24706
|
+
clone2.autoGenerate = { ...node.autoGenerate };
|
|
24687
24707
|
clone2.transformFlags = node.transformFlags;
|
|
24688
24708
|
setOriginalNode(clone2, node);
|
|
24689
24709
|
return clone2;
|
|
@@ -24704,10 +24724,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24704
24724
|
function cloneGeneratedPrivateIdentifier(node) {
|
|
24705
24725
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
24706
24726
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
24707
|
-
clone2.
|
|
24708
|
-
clone2.autoGenerateId = node.autoGenerateId;
|
|
24709
|
-
clone2.autoGeneratePrefix = node.autoGeneratePrefix;
|
|
24710
|
-
clone2.autoGenerateSuffix = node.autoGenerateSuffix;
|
|
24727
|
+
clone2.autoGenerate = { ...node.autoGenerate };
|
|
24711
24728
|
clone2.transformFlags = node.transformFlags;
|
|
24712
24729
|
setOriginalNode(clone2, node);
|
|
24713
24730
|
return clone2;
|
|
@@ -28070,13 +28087,13 @@ function elideNodes(factory2, nodes) {
|
|
|
28070
28087
|
return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes);
|
|
28071
28088
|
}
|
|
28072
28089
|
function getNodeForGeneratedName(name) {
|
|
28073
|
-
if (name.
|
|
28074
|
-
const autoGenerateId = name.
|
|
28090
|
+
if (name.autoGenerate.flags & 4 /* Node */) {
|
|
28091
|
+
const autoGenerateId = name.autoGenerate.id;
|
|
28075
28092
|
let node = name;
|
|
28076
28093
|
let original = node.original;
|
|
28077
28094
|
while (original) {
|
|
28078
28095
|
node = original;
|
|
28079
|
-
if (isMemberName(node) && !!(node.
|
|
28096
|
+
if (isMemberName(node) && (node.autoGenerate === void 0 || !!(node.autoGenerate.flags & 4 /* Node */) && node.autoGenerate.id !== autoGenerateId)) {
|
|
28080
28097
|
break;
|
|
28081
28098
|
}
|
|
28082
28099
|
original = node.original;
|
|
@@ -35890,12 +35907,14 @@ var commandOptionsWithoutBuild = [
|
|
|
35890
35907
|
{
|
|
35891
35908
|
name: "moduleResolution",
|
|
35892
35909
|
type: new Map(getEntries({
|
|
35893
|
-
|
|
35910
|
+
node10: 2 /* Node10 */,
|
|
35911
|
+
node: 2 /* Node10 */,
|
|
35894
35912
|
classic: 1 /* Classic */,
|
|
35895
35913
|
node16: 3 /* Node16 */,
|
|
35896
35914
|
nodenext: 99 /* NodeNext */,
|
|
35897
35915
|
bundler: 100 /* Bundler */
|
|
35898
35916
|
})),
|
|
35917
|
+
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
35899
35918
|
affectsModuleResolution: true,
|
|
35900
35919
|
paramType: Diagnostics.STRATEGY,
|
|
35901
35920
|
category: Diagnostics.Modules,
|
|
@@ -36415,6 +36434,11 @@ var commandOptionsWithoutBuild = [
|
|
|
36415
36434
|
description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
36416
36435
|
category: Diagnostics.Language_and_Environment,
|
|
36417
36436
|
defaultValueDescription: Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules
|
|
36437
|
+
},
|
|
36438
|
+
{
|
|
36439
|
+
name: "ignoreDeprecations",
|
|
36440
|
+
type: "string",
|
|
36441
|
+
defaultValueDescription: void 0
|
|
36418
36442
|
}
|
|
36419
36443
|
];
|
|
36420
36444
|
var optionDeclarations = [
|
|
@@ -36539,8 +36563,9 @@ function createCompilerDiagnosticForInvalidCustomType(opt) {
|
|
|
36539
36563
|
return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic);
|
|
36540
36564
|
}
|
|
36541
36565
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
36542
|
-
const namesOfType = arrayFrom(opt.type.keys())
|
|
36543
|
-
|
|
36566
|
+
const namesOfType = arrayFrom(opt.type.keys());
|
|
36567
|
+
const stringNames = (opt.deprecatedKeys ? namesOfType.filter((k) => !opt.deprecatedKeys.has(k)) : namesOfType).map((key) => `'${key}'`).join(", ");
|
|
36568
|
+
return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
|
|
36544
36569
|
}
|
|
36545
36570
|
function parseCustomTypeOption(opt, value, errors) {
|
|
36546
36571
|
return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors);
|
|
@@ -37776,7 +37801,7 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag
|
|
|
37776
37801
|
}
|
|
37777
37802
|
return extendedConfigPath;
|
|
37778
37803
|
}
|
|
37779
|
-
const resolved = nodeModuleNameResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), { moduleResolution: 2 /*
|
|
37804
|
+
const resolved = nodeModuleNameResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), { moduleResolution: 2 /* Node10 */ }, host, void 0, void 0, true);
|
|
37780
37805
|
if (resolved.resolvedModule) {
|
|
37781
37806
|
return resolved.resolvedModule.resolvedFileName;
|
|
37782
37807
|
}
|
|
@@ -38972,7 +38997,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
38972
38997
|
if (moduleResolution === void 0) {
|
|
38973
38998
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
38974
38999
|
case 1 /* CommonJS */:
|
|
38975
|
-
moduleResolution = 2 /*
|
|
39000
|
+
moduleResolution = 2 /* Node10 */;
|
|
38976
39001
|
break;
|
|
38977
39002
|
case 100 /* Node16 */:
|
|
38978
39003
|
moduleResolution = 3 /* Node16 */;
|
|
@@ -39000,7 +39025,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
39000
39025
|
case 99 /* NodeNext */:
|
|
39001
39026
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
39002
39027
|
break;
|
|
39003
|
-
case 2 /*
|
|
39028
|
+
case 2 /* Node10 */:
|
|
39004
39029
|
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
39005
39030
|
break;
|
|
39006
39031
|
case 1 /* Classic */:
|
|
@@ -39189,7 +39214,7 @@ function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
|
39189
39214
|
0 /* None */,
|
|
39190
39215
|
moduleName,
|
|
39191
39216
|
initialDir,
|
|
39192
|
-
{ moduleResolution: 2 /*
|
|
39217
|
+
{ moduleResolution: 2 /* Node10 */, allowJs: true },
|
|
39193
39218
|
host,
|
|
39194
39219
|
void 0,
|
|
39195
39220
|
2 /* JavaScript */,
|
|
@@ -39242,7 +39267,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
39242
39267
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
39243
39268
|
}
|
|
39244
39269
|
let result;
|
|
39245
|
-
if (getEmitModuleResolutionKind(compilerOptions) === 2 /*
|
|
39270
|
+
if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) {
|
|
39246
39271
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
39247
39272
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
39248
39273
|
result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
|
|
@@ -43947,8 +43972,8 @@ var intrinsicTypeKinds = new Map(getEntries({
|
|
|
43947
43972
|
Capitalize: 2 /* Capitalize */,
|
|
43948
43973
|
Uncapitalize: 3 /* Uncapitalize */
|
|
43949
43974
|
}));
|
|
43950
|
-
|
|
43951
|
-
}
|
|
43975
|
+
var SymbolLinks = class {
|
|
43976
|
+
};
|
|
43952
43977
|
function NodeLinks() {
|
|
43953
43978
|
this.flags = 0 /* None */;
|
|
43954
43979
|
}
|
|
@@ -44803,7 +44828,8 @@ function createTypeChecker(host) {
|
|
|
44803
44828
|
function createSymbol(flags, name, checkFlags) {
|
|
44804
44829
|
symbolCount++;
|
|
44805
44830
|
const symbol = new Symbol46(flags | 33554432 /* Transient */, name);
|
|
44806
|
-
symbol.
|
|
44831
|
+
symbol.links = new SymbolLinks();
|
|
44832
|
+
symbol.links.checkFlags = checkFlags || 0 /* None */;
|
|
44807
44833
|
return symbol;
|
|
44808
44834
|
}
|
|
44809
44835
|
function getExcludedSymbolFlags(flags) {
|
|
@@ -45028,10 +45054,11 @@ function createTypeChecker(host) {
|
|
|
45028
45054
|
}
|
|
45029
45055
|
}
|
|
45030
45056
|
function getSymbolLinks(symbol) {
|
|
45057
|
+
var _a2;
|
|
45031
45058
|
if (symbol.flags & 33554432 /* Transient */)
|
|
45032
|
-
return symbol;
|
|
45059
|
+
return symbol.links;
|
|
45033
45060
|
const id = getSymbolId(symbol);
|
|
45034
|
-
return symbolLinks[id]
|
|
45061
|
+
return (_a2 = symbolLinks[id]) != null ? _a2 : symbolLinks[id] = new SymbolLinks();
|
|
45035
45062
|
}
|
|
45036
45063
|
function getNodeLinks(node) {
|
|
45037
45064
|
const nodeId = getNodeId(node);
|
|
@@ -46565,7 +46592,7 @@ function createTypeChecker(host) {
|
|
|
46565
46592
|
}
|
|
46566
46593
|
function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) {
|
|
46567
46594
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
46568
|
-
const errorMessage = isClassic ? Diagnostics.
|
|
46595
|
+
const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
|
|
46569
46596
|
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage);
|
|
46570
46597
|
}
|
|
46571
46598
|
function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation = false) {
|
|
@@ -46831,8 +46858,8 @@ function createTypeChecker(host) {
|
|
|
46831
46858
|
const result = createSymbol(symbol.flags, symbol.escapedName);
|
|
46832
46859
|
result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
|
|
46833
46860
|
result.parent = symbol.parent;
|
|
46834
|
-
result.target = symbol;
|
|
46835
|
-
result.originatingImport = referenceParent;
|
|
46861
|
+
result.links.target = symbol;
|
|
46862
|
+
result.links.originatingImport = referenceParent;
|
|
46836
46863
|
if (symbol.valueDeclaration)
|
|
46837
46864
|
result.valueDeclaration = symbol.valueDeclaration;
|
|
46838
46865
|
if (symbol.constEnumOnlyModule)
|
|
@@ -46842,7 +46869,7 @@ function createTypeChecker(host) {
|
|
|
46842
46869
|
if (symbol.exports)
|
|
46843
46870
|
result.exports = new Map(symbol.exports);
|
|
46844
46871
|
const resolvedModuleType = resolveStructuredTypeMembers(moduleType);
|
|
46845
|
-
result.type = createAnonymousType(result, resolvedModuleType.members, emptyArray, emptyArray, resolvedModuleType.indexInfos);
|
|
46872
|
+
result.links.type = createAnonymousType(result, resolvedModuleType.members, emptyArray, emptyArray, resolvedModuleType.indexInfos);
|
|
46846
46873
|
return result;
|
|
46847
46874
|
}
|
|
46848
46875
|
function hasExportAssignmentSymbol(moduleSymbol) {
|
|
@@ -48297,7 +48324,7 @@ function createTypeChecker(host) {
|
|
|
48297
48324
|
}
|
|
48298
48325
|
function shouldUsePlaceholderForProperty(propertySymbol, context) {
|
|
48299
48326
|
var _a2;
|
|
48300
|
-
return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((_a2 = context.reverseMappedStack) == null ? void 0 : _a2[0]) && !(getObjectFlags(last(context.reverseMappedStack).propertyType) & 16 /* Anonymous */));
|
|
48327
|
+
return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((_a2 = context.reverseMappedStack) == null ? void 0 : _a2[0]) && !(getObjectFlags(last(context.reverseMappedStack).links.propertyType) & 16 /* Anonymous */));
|
|
48301
48328
|
}
|
|
48302
48329
|
function addPropertyToElementList(propertySymbol, context, typeElements) {
|
|
48303
48330
|
var _a2;
|
|
@@ -48673,7 +48700,7 @@ function createTypeChecker(host) {
|
|
|
48673
48700
|
const params = getTypeParametersOfClassOrInterface(
|
|
48674
48701
|
parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol
|
|
48675
48702
|
);
|
|
48676
|
-
typeParameterNodes = mapToTypeNodes(map(params, (t) => getMappedType(t, nextSymbol.mapper)), context);
|
|
48703
|
+
typeParameterNodes = mapToTypeNodes(map(params, (t) => getMappedType(t, nextSymbol.links.mapper)), context);
|
|
48677
48704
|
} else {
|
|
48678
48705
|
typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context);
|
|
48679
48706
|
}
|
|
@@ -51150,7 +51177,7 @@ function createTypeChecker(host) {
|
|
|
51150
51177
|
);
|
|
51151
51178
|
}
|
|
51152
51179
|
const union = createSymbol(s.flags | exportedMember.flags, name);
|
|
51153
|
-
union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
|
|
51180
|
+
union.links.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
|
|
51154
51181
|
union.valueDeclaration = exportedMember.valueDeclaration;
|
|
51155
51182
|
union.declarations = concatenate(exportedMember.declarations, s.declarations);
|
|
51156
51183
|
members.set(name, union);
|
|
@@ -51237,8 +51264,8 @@ function createTypeChecker(host) {
|
|
|
51237
51264
|
const text = getPropertyNameFromType(exprType);
|
|
51238
51265
|
const flags = 4 /* Property */ | (e.initializer ? 16777216 /* Optional */ : 0);
|
|
51239
51266
|
const symbol = createSymbol(flags, text);
|
|
51240
|
-
symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors2);
|
|
51241
|
-
symbol.bindingElement = e;
|
|
51267
|
+
symbol.links.type = getTypeFromBindingElement(e, includePatternInType, reportErrors2);
|
|
51268
|
+
symbol.links.bindingElement = e;
|
|
51242
51269
|
members.set(symbol.escapedName, symbol);
|
|
51243
51270
|
});
|
|
51244
51271
|
const result = createAnonymousType(void 0, members, emptyArray, emptyArray, stringIndexInfo ? [stringIndexInfo] : emptyArray);
|
|
@@ -51346,7 +51373,7 @@ function createTypeChecker(host) {
|
|
|
51346
51373
|
const result = createSymbol(fileSymbol.flags, "exports");
|
|
51347
51374
|
result.declarations = fileSymbol.declarations ? fileSymbol.declarations.slice() : [];
|
|
51348
51375
|
result.parent = symbol;
|
|
51349
|
-
result.target = fileSymbol;
|
|
51376
|
+
result.links.target = fileSymbol;
|
|
51350
51377
|
if (fileSymbol.valueDeclaration)
|
|
51351
51378
|
result.valueDeclaration = fileSymbol.valueDeclaration;
|
|
51352
51379
|
if (fileSymbol.members)
|
|
@@ -51512,7 +51539,8 @@ function createTypeChecker(host) {
|
|
|
51512
51539
|
if (expando) {
|
|
51513
51540
|
const merged = mergeJSSymbols(symbol, expando);
|
|
51514
51541
|
if (merged) {
|
|
51515
|
-
symbol =
|
|
51542
|
+
symbol = merged;
|
|
51543
|
+
links = merged.links;
|
|
51516
51544
|
}
|
|
51517
51545
|
}
|
|
51518
51546
|
originalLinks.type = links.type = getTypeOfFuncClassEnumModuleWorker(symbol);
|
|
@@ -51609,7 +51637,7 @@ function createTypeChecker(host) {
|
|
|
51609
51637
|
function getWriteTypeOfSymbol(symbol) {
|
|
51610
51638
|
const checkFlags = getCheckFlags(symbol);
|
|
51611
51639
|
if (symbol.flags & 4 /* Property */) {
|
|
51612
|
-
return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.writeType || symbol.type : getTypeOfSymbol(symbol);
|
|
51640
|
+
return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.links.writeType || symbol.links.type : getTypeOfSymbol(symbol);
|
|
51613
51641
|
}
|
|
51614
51642
|
if (symbol.flags & 98304 /* Accessor */) {
|
|
51615
51643
|
return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
|
|
@@ -52011,7 +52039,8 @@ function createTypeChecker(host) {
|
|
|
52011
52039
|
const kind = symbol.flags & 32 /* Class */ ? 1 /* Class */ : 2 /* Interface */;
|
|
52012
52040
|
const merged = mergeJSSymbols(symbol, symbol.valueDeclaration && getAssignedClassSymbol(symbol.valueDeclaration));
|
|
52013
52041
|
if (merged) {
|
|
52014
|
-
symbol =
|
|
52042
|
+
symbol = merged;
|
|
52043
|
+
links = merged.links;
|
|
52015
52044
|
}
|
|
52016
52045
|
const type = originalLinks.declaredType = links.declaredType = createObjectType(kind, symbol);
|
|
52017
52046
|
const outerTypeParameters = getOuterTypeParametersOfClassOrInterface(symbol);
|
|
@@ -52287,7 +52316,7 @@ function createTypeChecker(host) {
|
|
|
52287
52316
|
error(declName || decl, Diagnostics.Duplicate_property_0, name);
|
|
52288
52317
|
lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */);
|
|
52289
52318
|
}
|
|
52290
|
-
lateSymbol.nameType = type;
|
|
52319
|
+
lateSymbol.links.nameType = type;
|
|
52291
52320
|
addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags);
|
|
52292
52321
|
if (lateSymbol.parent) {
|
|
52293
52322
|
Debug.assert(lateSymbol.parent === parent2, "Existing symbol parent should match new one");
|
|
@@ -52493,7 +52522,7 @@ function createTypeChecker(host) {
|
|
|
52493
52522
|
const flags = restType.target.elementFlags[i];
|
|
52494
52523
|
const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
|
|
52495
52524
|
const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
|
|
52496
|
-
symbol.type = flags & 4 /* Rest */ ? createArrayType(t) : t;
|
|
52525
|
+
symbol.links.type = flags & 4 /* Rest */ ? createArrayType(t) : t;
|
|
52497
52526
|
return symbol;
|
|
52498
52527
|
});
|
|
52499
52528
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
@@ -52653,14 +52682,14 @@ function createTypeChecker(host) {
|
|
|
52653
52682
|
1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0),
|
|
52654
52683
|
paramName || `arg${i}`
|
|
52655
52684
|
);
|
|
52656
|
-
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
52685
|
+
paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
52657
52686
|
params[i] = paramSymbol;
|
|
52658
52687
|
}
|
|
52659
52688
|
if (needsExtraRestElement) {
|
|
52660
52689
|
const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args");
|
|
52661
|
-
restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
52690
|
+
restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
52662
52691
|
if (shorter === right) {
|
|
52663
|
-
restParamSymbol.type = instantiateType(restParamSymbol.type, mapper);
|
|
52692
|
+
restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper);
|
|
52664
52693
|
}
|
|
52665
52694
|
params[longestCount] = restParamSymbol;
|
|
52666
52695
|
}
|
|
@@ -52880,16 +52909,16 @@ function createTypeChecker(host) {
|
|
|
52880
52909
|
const checkFlags = 8192 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0);
|
|
52881
52910
|
const inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags);
|
|
52882
52911
|
inferredProp.declarations = prop.declarations;
|
|
52883
|
-
inferredProp.nameType = getSymbolLinks(prop).nameType;
|
|
52884
|
-
inferredProp.propertyType = getTypeOfSymbol(prop);
|
|
52912
|
+
inferredProp.links.nameType = getSymbolLinks(prop).nameType;
|
|
52913
|
+
inferredProp.links.propertyType = getTypeOfSymbol(prop);
|
|
52885
52914
|
if (type.constraintType.type.flags & 8388608 /* IndexedAccess */ && type.constraintType.type.objectType.flags & 262144 /* TypeParameter */ && type.constraintType.type.indexType.flags & 262144 /* TypeParameter */) {
|
|
52886
52915
|
const newTypeParam = type.constraintType.type.objectType;
|
|
52887
52916
|
const newMappedType = replaceIndexedAccess(type.mappedType, type.constraintType.type, newTypeParam);
|
|
52888
|
-
inferredProp.mappedType = newMappedType;
|
|
52889
|
-
inferredProp.constraintType = getIndexType(newTypeParam);
|
|
52917
|
+
inferredProp.links.mappedType = newMappedType;
|
|
52918
|
+
inferredProp.links.constraintType = getIndexType(newTypeParam);
|
|
52890
52919
|
} else {
|
|
52891
|
-
inferredProp.mappedType = type.mappedType;
|
|
52892
|
-
inferredProp.constraintType = type.constraintType;
|
|
52920
|
+
inferredProp.links.mappedType = type.mappedType;
|
|
52921
|
+
inferredProp.links.constraintType = type.constraintType;
|
|
52893
52922
|
}
|
|
52894
52923
|
members.set(prop.escapedName, inferredProp);
|
|
52895
52924
|
}
|
|
@@ -52965,8 +52994,8 @@ function createTypeChecker(host) {
|
|
|
52965
52994
|
const propName = getPropertyNameFromType(propNameType);
|
|
52966
52995
|
const existingProp = members.get(propName);
|
|
52967
52996
|
if (existingProp) {
|
|
52968
|
-
existingProp.nameType = getUnionType([existingProp.nameType, propNameType]);
|
|
52969
|
-
existingProp.keyType = getUnionType([existingProp.keyType, keyType]);
|
|
52997
|
+
existingProp.links.nameType = getUnionType([existingProp.links.nameType, propNameType]);
|
|
52998
|
+
existingProp.links.keyType = getUnionType([existingProp.links.keyType, keyType]);
|
|
52970
52999
|
} else {
|
|
52971
53000
|
const modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : void 0;
|
|
52972
53001
|
const isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */);
|
|
@@ -52978,11 +53007,11 @@ function createTypeChecker(host) {
|
|
|
52978
53007
|
propName,
|
|
52979
53008
|
lateFlag | 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0)
|
|
52980
53009
|
);
|
|
52981
|
-
prop.mappedType = type;
|
|
52982
|
-
prop.nameType = propNameType;
|
|
52983
|
-
prop.keyType = keyType;
|
|
53010
|
+
prop.links.mappedType = type;
|
|
53011
|
+
prop.links.nameType = propNameType;
|
|
53012
|
+
prop.links.keyType = keyType;
|
|
52984
53013
|
if (modifiersProp) {
|
|
52985
|
-
prop.syntheticOrigin = modifiersProp;
|
|
53014
|
+
prop.links.syntheticOrigin = modifiersProp;
|
|
52986
53015
|
prop.declarations = nameType ? void 0 : modifiersProp.declarations;
|
|
52987
53016
|
}
|
|
52988
53017
|
members.set(propName, prop);
|
|
@@ -52996,23 +53025,23 @@ function createTypeChecker(host) {
|
|
|
52996
53025
|
}
|
|
52997
53026
|
}
|
|
52998
53027
|
function getTypeOfMappedSymbol(symbol) {
|
|
52999
|
-
if (!symbol.type) {
|
|
53000
|
-
const mappedType = symbol.mappedType;
|
|
53028
|
+
if (!symbol.links.type) {
|
|
53029
|
+
const mappedType = symbol.links.mappedType;
|
|
53001
53030
|
if (!pushTypeResolution(symbol, 0 /* Type */)) {
|
|
53002
53031
|
mappedType.containsError = true;
|
|
53003
53032
|
return errorType;
|
|
53004
53033
|
}
|
|
53005
53034
|
const templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType);
|
|
53006
|
-
const mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType);
|
|
53035
|
+
const mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.links.keyType);
|
|
53007
53036
|
const propType = instantiateType(templateType, mapper);
|
|
53008
|
-
let type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType, true) : symbol.checkFlags & 524288 /* StripOptional */ ? removeMissingOrUndefinedType(propType) : propType;
|
|
53037
|
+
let type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType, true) : symbol.links.checkFlags & 524288 /* StripOptional */ ? removeMissingOrUndefinedType(propType) : propType;
|
|
53009
53038
|
if (!popTypeResolution()) {
|
|
53010
53039
|
error(currentNode, Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType));
|
|
53011
53040
|
type = errorType;
|
|
53012
53041
|
}
|
|
53013
|
-
symbol.type = type;
|
|
53042
|
+
symbol.links.type = type;
|
|
53014
53043
|
}
|
|
53015
|
-
return symbol.type;
|
|
53044
|
+
return symbol.links.type;
|
|
53016
53045
|
}
|
|
53017
53046
|
function getTypeParameterFromMappedType(type) {
|
|
53018
53047
|
return type.typeParameter || (type.typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(type.declaration.typeParameter)));
|
|
@@ -53427,7 +53456,7 @@ function createTypeChecker(host) {
|
|
|
53427
53456
|
return getReducedType(getApparentType(getReducedType(type)));
|
|
53428
53457
|
}
|
|
53429
53458
|
function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) {
|
|
53430
|
-
var _a2, _b;
|
|
53459
|
+
var _a2, _b, _c;
|
|
53431
53460
|
let singleProp;
|
|
53432
53461
|
let propSet;
|
|
53433
53462
|
let indexTypes;
|
|
@@ -53495,10 +53524,11 @@ function createTypeChecker(host) {
|
|
|
53495
53524
|
}
|
|
53496
53525
|
if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) {
|
|
53497
53526
|
if (mergedInstantiations) {
|
|
53498
|
-
const
|
|
53499
|
-
clone2
|
|
53500
|
-
clone2.
|
|
53501
|
-
clone2.
|
|
53527
|
+
const links = (_a2 = tryCast(singleProp, isTransientSymbol)) == null ? void 0 : _a2.links;
|
|
53528
|
+
const clone2 = createSymbolWithType(singleProp, links == null ? void 0 : links.type);
|
|
53529
|
+
clone2.parent = (_c = (_b = singleProp.valueDeclaration) == null ? void 0 : _b.symbol) == null ? void 0 : _c.parent;
|
|
53530
|
+
clone2.links.containingType = containingType;
|
|
53531
|
+
clone2.links.mapper = links == null ? void 0 : links.mapper;
|
|
53502
53532
|
return clone2;
|
|
53503
53533
|
} else {
|
|
53504
53534
|
return singleProp;
|
|
@@ -53540,7 +53570,7 @@ function createTypeChecker(host) {
|
|
|
53540
53570
|
}
|
|
53541
53571
|
addRange(propTypes, indexTypes);
|
|
53542
53572
|
const result = createSymbol(4 /* Property */ | (optionalFlag != null ? optionalFlag : 0), name, syntheticFlag | checkFlags);
|
|
53543
|
-
result.containingType = containingType;
|
|
53573
|
+
result.links.containingType = containingType;
|
|
53544
53574
|
if (!hasNonUniformValueDeclaration && firstValueDeclaration) {
|
|
53545
53575
|
result.valueDeclaration = firstValueDeclaration;
|
|
53546
53576
|
if (firstValueDeclaration.symbol.parent) {
|
|
@@ -53548,16 +53578,16 @@ function createTypeChecker(host) {
|
|
|
53548
53578
|
}
|
|
53549
53579
|
}
|
|
53550
53580
|
result.declarations = declarations;
|
|
53551
|
-
result.nameType = nameType;
|
|
53581
|
+
result.links.nameType = nameType;
|
|
53552
53582
|
if (propTypes.length > 2) {
|
|
53553
|
-
result.checkFlags |= 65536 /* DeferredType */;
|
|
53554
|
-
result.deferralParent = containingType;
|
|
53555
|
-
result.deferralConstituents = propTypes;
|
|
53556
|
-
result.deferralWriteConstituents = writeTypes;
|
|
53583
|
+
result.links.checkFlags |= 65536 /* DeferredType */;
|
|
53584
|
+
result.links.deferralParent = containingType;
|
|
53585
|
+
result.links.deferralConstituents = propTypes;
|
|
53586
|
+
result.links.deferralWriteConstituents = writeTypes;
|
|
53557
53587
|
} else {
|
|
53558
|
-
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
53588
|
+
result.links.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
53559
53589
|
if (writeTypes) {
|
|
53560
|
-
result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
53590
|
+
result.links.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
53561
53591
|
}
|
|
53562
53592
|
}
|
|
53563
53593
|
return result;
|
|
@@ -53894,12 +53924,12 @@ function createTypeChecker(host) {
|
|
|
53894
53924
|
const lastParamVariadicType = firstDefined(lastParamTags, (p) => p.typeExpression && isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : void 0);
|
|
53895
53925
|
const syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 32768 /* RestParameter */);
|
|
53896
53926
|
if (lastParamVariadicType) {
|
|
53897
|
-
syntheticArgsSymbol.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
53927
|
+
syntheticArgsSymbol.links.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
53898
53928
|
} else {
|
|
53899
|
-
syntheticArgsSymbol.checkFlags |= 65536 /* DeferredType */;
|
|
53900
|
-
syntheticArgsSymbol.deferralParent = neverType;
|
|
53901
|
-
syntheticArgsSymbol.deferralConstituents = [anyArrayType];
|
|
53902
|
-
syntheticArgsSymbol.deferralWriteConstituents = [anyArrayType];
|
|
53929
|
+
syntheticArgsSymbol.links.checkFlags |= 65536 /* DeferredType */;
|
|
53930
|
+
syntheticArgsSymbol.links.deferralParent = neverType;
|
|
53931
|
+
syntheticArgsSymbol.links.deferralConstituents = [anyArrayType];
|
|
53932
|
+
syntheticArgsSymbol.links.deferralWriteConstituents = [anyArrayType];
|
|
53903
53933
|
}
|
|
53904
53934
|
if (lastParamVariadicType) {
|
|
53905
53935
|
parameters.pop();
|
|
@@ -54513,7 +54543,7 @@ function createTypeChecker(host) {
|
|
|
54513
54543
|
if (!result) {
|
|
54514
54544
|
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
|
|
54515
54545
|
result.parent = parentSymbol;
|
|
54516
|
-
result.declaredType = unresolvedType;
|
|
54546
|
+
result.links.declaredType = unresolvedType;
|
|
54517
54547
|
}
|
|
54518
54548
|
return result;
|
|
54519
54549
|
}
|
|
@@ -54790,7 +54820,7 @@ function createTypeChecker(host) {
|
|
|
54790
54820
|
const importMetaType = getGlobalImportMetaType();
|
|
54791
54821
|
const metaPropertySymbol = createSymbol(4 /* Property */, "meta", 8 /* Readonly */);
|
|
54792
54822
|
metaPropertySymbol.parent = symbol;
|
|
54793
|
-
metaPropertySymbol.type = importMetaType;
|
|
54823
|
+
metaPropertySymbol.links.type = importMetaType;
|
|
54794
54824
|
const members = createSymbolTable([metaPropertySymbol]);
|
|
54795
54825
|
symbol.members = members;
|
|
54796
54826
|
deferredGlobalImportMetaExpressionType = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
@@ -55015,8 +55045,8 @@ function createTypeChecker(host) {
|
|
|
55015
55045
|
"" + i,
|
|
55016
55046
|
readonly ? 8 /* Readonly */ : 0
|
|
55017
55047
|
);
|
|
55018
|
-
property.tupleLabelDeclaration = namedMemberDeclarations == null ? void 0 : namedMemberDeclarations[i];
|
|
55019
|
-
property.type = typeParameter;
|
|
55048
|
+
property.links.tupleLabelDeclaration = namedMemberDeclarations == null ? void 0 : namedMemberDeclarations[i];
|
|
55049
|
+
property.links.type = typeParameter;
|
|
55020
55050
|
properties.push(property);
|
|
55021
55051
|
}
|
|
55022
55052
|
}
|
|
@@ -55024,12 +55054,12 @@ function createTypeChecker(host) {
|
|
|
55024
55054
|
const fixedLength = properties.length;
|
|
55025
55055
|
const lengthSymbol = createSymbol(4 /* Property */, "length", readonly ? 8 /* Readonly */ : 0);
|
|
55026
55056
|
if (combinedFlags & 12 /* Variable */) {
|
|
55027
|
-
lengthSymbol.type = numberType;
|
|
55057
|
+
lengthSymbol.links.type = numberType;
|
|
55028
55058
|
} else {
|
|
55029
55059
|
const literalTypes = [];
|
|
55030
55060
|
for (let i = minLength; i <= arity; i++)
|
|
55031
55061
|
literalTypes.push(getNumberLiteralType(i));
|
|
55032
|
-
lengthSymbol.type = getUnionType(literalTypes);
|
|
55062
|
+
lengthSymbol.links.type = getUnionType(literalTypes);
|
|
55033
55063
|
}
|
|
55034
55064
|
properties.push(lengthSymbol);
|
|
55035
55065
|
const type = createObjectType(8 /* Tuple */ | 4 /* Reference */);
|
|
@@ -56623,10 +56653,10 @@ function createTypeChecker(host) {
|
|
|
56623
56653
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
56624
56654
|
const flags = 4 /* Property */ | 16777216 /* Optional */;
|
|
56625
56655
|
const result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));
|
|
56626
|
-
result.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), true);
|
|
56656
|
+
result.links.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), true);
|
|
56627
56657
|
result.declarations = prop.declarations;
|
|
56628
|
-
result.nameType = getSymbolLinks(prop).nameType;
|
|
56629
|
-
result.syntheticOrigin = prop;
|
|
56658
|
+
result.links.nameType = getSymbolLinks(prop).nameType;
|
|
56659
|
+
result.links.syntheticOrigin = prop;
|
|
56630
56660
|
members.set(prop.escapedName, result);
|
|
56631
56661
|
}
|
|
56632
56662
|
}
|
|
@@ -56693,11 +56723,11 @@ function createTypeChecker(host) {
|
|
|
56693
56723
|
const declarations = concatenate(leftProp.declarations, rightProp.declarations);
|
|
56694
56724
|
const flags = 4 /* Property */ | leftProp.flags & 16777216 /* Optional */;
|
|
56695
56725
|
const result = createSymbol(flags, leftProp.escapedName);
|
|
56696
|
-
result.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], 2 /* Subtype */);
|
|
56697
|
-
result.leftSpread = leftProp;
|
|
56698
|
-
result.rightSpread = rightProp;
|
|
56726
|
+
result.links.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], 2 /* Subtype */);
|
|
56727
|
+
result.links.leftSpread = leftProp;
|
|
56728
|
+
result.links.rightSpread = rightProp;
|
|
56699
56729
|
result.declarations = declarations;
|
|
56700
|
-
result.nameType = getSymbolLinks(leftProp).nameType;
|
|
56730
|
+
result.links.nameType = getSymbolLinks(leftProp).nameType;
|
|
56701
56731
|
members.set(leftProp.escapedName, result);
|
|
56702
56732
|
}
|
|
56703
56733
|
} else {
|
|
@@ -56719,10 +56749,10 @@ function createTypeChecker(host) {
|
|
|
56719
56749
|
}
|
|
56720
56750
|
const flags = 4 /* Property */ | prop.flags & 16777216 /* Optional */;
|
|
56721
56751
|
const result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));
|
|
56722
|
-
result.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);
|
|
56752
|
+
result.links.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);
|
|
56723
56753
|
result.declarations = prop.declarations;
|
|
56724
|
-
result.nameType = getSymbolLinks(prop).nameType;
|
|
56725
|
-
result.syntheticOrigin = prop;
|
|
56754
|
+
result.links.nameType = getSymbolLinks(prop).nameType;
|
|
56755
|
+
result.links.syntheticOrigin = prop;
|
|
56726
56756
|
return result;
|
|
56727
56757
|
}
|
|
56728
56758
|
function getIndexInfoWithReadonly(info, readonly) {
|
|
@@ -57087,13 +57117,13 @@ function createTypeChecker(host) {
|
|
|
57087
57117
|
const result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | getCheckFlags(symbol) & (8 /* Readonly */ | 4096 /* Late */ | 16384 /* OptionalParameter */ | 32768 /* RestParameter */));
|
|
57088
57118
|
result.declarations = symbol.declarations;
|
|
57089
57119
|
result.parent = symbol.parent;
|
|
57090
|
-
result.target = symbol;
|
|
57091
|
-
result.mapper = mapper;
|
|
57120
|
+
result.links.target = symbol;
|
|
57121
|
+
result.links.mapper = mapper;
|
|
57092
57122
|
if (symbol.valueDeclaration) {
|
|
57093
57123
|
result.valueDeclaration = symbol.valueDeclaration;
|
|
57094
57124
|
}
|
|
57095
57125
|
if (links.nameType) {
|
|
57096
|
-
result.nameType = links.nameType;
|
|
57126
|
+
result.links.nameType = links.nameType;
|
|
57097
57127
|
}
|
|
57098
57128
|
return result;
|
|
57099
57129
|
}
|
|
@@ -60131,7 +60161,7 @@ function createTypeChecker(host) {
|
|
|
60131
60161
|
}
|
|
60132
60162
|
function forEachProperty2(prop, callback) {
|
|
60133
60163
|
if (getCheckFlags(prop) & 6 /* Synthetic */) {
|
|
60134
|
-
for (const t of prop.containingType.types) {
|
|
60164
|
+
for (const t of prop.links.containingType.types) {
|
|
60135
60165
|
const p = getPropertyOfType(t, prop.escapedName);
|
|
60136
60166
|
const result = p && forEachProperty2(p, callback);
|
|
60137
60167
|
if (result) {
|
|
@@ -60545,14 +60575,14 @@ function createTypeChecker(host) {
|
|
|
60545
60575
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
60546
60576
|
symbol.declarations = source.declarations;
|
|
60547
60577
|
symbol.parent = source.parent;
|
|
60548
|
-
symbol.type = type;
|
|
60549
|
-
symbol.target = source;
|
|
60578
|
+
symbol.links.type = type;
|
|
60579
|
+
symbol.links.target = source;
|
|
60550
60580
|
if (source.valueDeclaration) {
|
|
60551
60581
|
symbol.valueDeclaration = source.valueDeclaration;
|
|
60552
60582
|
}
|
|
60553
60583
|
const nameType = getSymbolLinks(source).nameType;
|
|
60554
60584
|
if (nameType) {
|
|
60555
|
-
symbol.nameType = nameType;
|
|
60585
|
+
symbol.links.nameType = nameType;
|
|
60556
60586
|
}
|
|
60557
60587
|
return symbol;
|
|
60558
60588
|
}
|
|
@@ -60933,7 +60963,7 @@ function createTypeChecker(host) {
|
|
|
60933
60963
|
}
|
|
60934
60964
|
const name = escapeLeadingUnderscores(t.value);
|
|
60935
60965
|
const literalProp = createSymbol(4 /* Property */, name);
|
|
60936
|
-
literalProp.type = anyType;
|
|
60966
|
+
literalProp.links.type = anyType;
|
|
60937
60967
|
if (t.symbol) {
|
|
60938
60968
|
literalProp.declarations = t.symbol.declarations;
|
|
60939
60969
|
literalProp.valueDeclaration = t.symbol.valueDeclaration;
|
|
@@ -60981,7 +61011,7 @@ function createTypeChecker(host) {
|
|
|
60981
61011
|
function getTypeOfReverseMappedSymbol(symbol) {
|
|
60982
61012
|
const links = getSymbolLinks(symbol);
|
|
60983
61013
|
if (!links.type) {
|
|
60984
|
-
links.type = inferReverseMappedType(symbol.propertyType, symbol.mappedType, symbol.constraintType);
|
|
61014
|
+
links.type = inferReverseMappedType(symbol.links.propertyType, symbol.links.mappedType, symbol.links.constraintType);
|
|
60985
61015
|
}
|
|
60986
61016
|
return links.type;
|
|
60987
61017
|
}
|
|
@@ -61964,10 +61994,10 @@ function createTypeChecker(host) {
|
|
|
61964
61994
|
if (type && type.flags & 1048576 /* Union */) {
|
|
61965
61995
|
const prop = getUnionOrIntersectionProperty(type, name);
|
|
61966
61996
|
if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) {
|
|
61967
|
-
if (prop.isDiscriminantProperty === void 0) {
|
|
61968
|
-
prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop));
|
|
61997
|
+
if (prop.links.isDiscriminantProperty === void 0) {
|
|
61998
|
+
prop.links.isDiscriminantProperty = (prop.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop));
|
|
61969
61999
|
}
|
|
61970
|
-
return !!prop.isDiscriminantProperty;
|
|
62000
|
+
return !!prop.links.isDiscriminantProperty;
|
|
61971
62001
|
}
|
|
61972
62002
|
}
|
|
61973
62003
|
return false;
|
|
@@ -62489,7 +62519,7 @@ function createTypeChecker(host) {
|
|
|
62489
62519
|
}
|
|
62490
62520
|
if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {
|
|
62491
62521
|
if (getCheckFlags(symbol) & 262144 /* Mapped */) {
|
|
62492
|
-
const origin = symbol.syntheticOrigin;
|
|
62522
|
+
const origin = symbol.links.syntheticOrigin;
|
|
62493
62523
|
if (origin && getExplicitTypeOfSymbol(origin)) {
|
|
62494
62524
|
return getTypeOfSymbol(symbol);
|
|
62495
62525
|
}
|
|
@@ -64570,7 +64600,7 @@ function createTypeChecker(host) {
|
|
|
64570
64600
|
return nameStr !== void 0 && getTypeOfPropertyOfContextualType(thisType, nameStr) || void 0;
|
|
64571
64601
|
}
|
|
64572
64602
|
function isCircularMappedProperty(symbol) {
|
|
64573
|
-
return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0);
|
|
64603
|
+
return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.links.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0);
|
|
64574
64604
|
}
|
|
64575
64605
|
function getTypeOfPropertyOfContextualType(type, name, nameType) {
|
|
64576
64606
|
return mapType(type, (t) => {
|
|
@@ -64992,14 +65022,14 @@ function createTypeChecker(host) {
|
|
|
64992
65022
|
1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0),
|
|
64993
65023
|
paramName || `arg${i}`
|
|
64994
65024
|
);
|
|
64995
|
-
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
65025
|
+
paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
64996
65026
|
params[i] = paramSymbol;
|
|
64997
65027
|
}
|
|
64998
65028
|
if (needsExtraRestElement) {
|
|
64999
65029
|
const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args");
|
|
65000
|
-
restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
65030
|
+
restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
65001
65031
|
if (shorter === right) {
|
|
65002
|
-
restParamSymbol.type = instantiateType(restParamSymbol.type, mapper);
|
|
65032
|
+
restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper);
|
|
65003
65033
|
}
|
|
65004
65034
|
params[longestCount] = restParamSymbol;
|
|
65005
65035
|
}
|
|
@@ -65230,6 +65260,7 @@ function createTypeChecker(host) {
|
|
|
65230
65260
|
return links.immediateTarget;
|
|
65231
65261
|
}
|
|
65232
65262
|
function checkObjectLiteral(node, checkMode) {
|
|
65263
|
+
var _a2;
|
|
65233
65264
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
65234
65265
|
checkGrammarObjectLiteralExpression(node, inDestructuringPattern);
|
|
65235
65266
|
const allPropertiesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
@@ -65272,7 +65303,7 @@ function createTypeChecker(host) {
|
|
|
65272
65303
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
65273
65304
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
65274
65305
|
if (nameType) {
|
|
65275
|
-
prop.nameType = nameType;
|
|
65306
|
+
prop.links.nameType = nameType;
|
|
65276
65307
|
}
|
|
65277
65308
|
if (inDestructuringPattern) {
|
|
65278
65309
|
const isOptional = memberDecl.kind === 299 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 300 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
|
|
@@ -65297,8 +65328,8 @@ function createTypeChecker(host) {
|
|
|
65297
65328
|
if (member.valueDeclaration) {
|
|
65298
65329
|
prop.valueDeclaration = member.valueDeclaration;
|
|
65299
65330
|
}
|
|
65300
|
-
prop.type = type;
|
|
65301
|
-
prop.target = member;
|
|
65331
|
+
prop.links.type = type;
|
|
65332
|
+
prop.links.target = member;
|
|
65302
65333
|
member = prop;
|
|
65303
65334
|
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
65304
65335
|
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 299 /* PropertyAssignment */ || memberDecl.kind === 171 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
|
|
@@ -65371,7 +65402,7 @@ function createTypeChecker(host) {
|
|
|
65371
65402
|
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
|
|
65372
65403
|
if (!(prop.flags & 16777216 /* Optional */)) {
|
|
65373
65404
|
error(
|
|
65374
|
-
prop.valueDeclaration || prop.bindingElement,
|
|
65405
|
+
prop.valueDeclaration || ((_a2 = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a2.links.bindingElement),
|
|
65375
65406
|
Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value
|
|
65376
65407
|
);
|
|
65377
65408
|
}
|
|
@@ -65481,8 +65512,8 @@ function createTypeChecker(host) {
|
|
|
65481
65512
|
if (member.valueDeclaration) {
|
|
65482
65513
|
attributeSymbol.valueDeclaration = member.valueDeclaration;
|
|
65483
65514
|
}
|
|
65484
|
-
attributeSymbol.type = exprType;
|
|
65485
|
-
attributeSymbol.target = member;
|
|
65515
|
+
attributeSymbol.links.type = exprType;
|
|
65516
|
+
attributeSymbol.links.target = member;
|
|
65486
65517
|
attributesTable.set(attributeSymbol.escapedName, attributeSymbol);
|
|
65487
65518
|
allAttributesTable == null ? void 0 : allAttributesTable.set(attributeSymbol.escapedName, attributeSymbol);
|
|
65488
65519
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
@@ -65530,7 +65561,7 @@ function createTypeChecker(host) {
|
|
|
65530
65561
|
const contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes, void 0);
|
|
65531
65562
|
const childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName);
|
|
65532
65563
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
65533
|
-
childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
65564
|
+
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
65534
65565
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(void 0, unescapeLeadingUnderscores(jsxChildrenPropertyName), void 0, void 0);
|
|
65535
65566
|
setParent(childrenPropSymbol.valueDeclaration, attributes);
|
|
65536
65567
|
childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol;
|
|
@@ -65636,7 +65667,7 @@ function createTypeChecker(host) {
|
|
|
65636
65667
|
return void 0;
|
|
65637
65668
|
}
|
|
65638
65669
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
65639
|
-
const errorMessage = isClassic ? Diagnostics.
|
|
65670
|
+
const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
|
|
65640
65671
|
const mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location);
|
|
65641
65672
|
const result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : void 0;
|
|
65642
65673
|
if (links) {
|
|
@@ -68041,7 +68072,7 @@ function createTypeChecker(host) {
|
|
|
68041
68072
|
returnNode ? factory.createTypeReferenceNode(returnNode, void 0) : factory.createKeywordTypeNode(131 /* AnyKeyword */)
|
|
68042
68073
|
);
|
|
68043
68074
|
const parameterSymbol = createSymbol(1 /* FunctionScopedVariable */, "props");
|
|
68044
|
-
parameterSymbol.type = result;
|
|
68075
|
+
parameterSymbol.links.type = result;
|
|
68045
68076
|
return createSignature(
|
|
68046
68077
|
declaration,
|
|
68047
68078
|
void 0,
|
|
@@ -68334,8 +68365,8 @@ function createTypeChecker(host) {
|
|
|
68334
68365
|
const memberTable = createSymbolTable();
|
|
68335
68366
|
const newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */);
|
|
68336
68367
|
newSymbol.parent = originalSymbol;
|
|
68337
|
-
newSymbol.nameType = getStringLiteralType("default");
|
|
68338
|
-
newSymbol.aliasTarget = resolveSymbol(symbol);
|
|
68368
|
+
newSymbol.links.nameType = getStringLiteralType("default");
|
|
68369
|
+
newSymbol.links.aliasTarget = resolveSymbol(symbol);
|
|
68339
68370
|
memberTable.set("default" /* Default */, newSymbol);
|
|
68340
68371
|
return createAnonymousType(anonymousSymbol, memberTable, emptyArray, emptyArray, emptyArray);
|
|
68341
68372
|
}
|
|
@@ -68361,7 +68392,7 @@ function createTypeChecker(host) {
|
|
|
68361
68392
|
if (hasSyntheticDefault) {
|
|
68362
68393
|
const anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
68363
68394
|
const defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol);
|
|
68364
|
-
anonymousSymbol.type = defaultContainingObject;
|
|
68395
|
+
anonymousSymbol.links.type = defaultContainingObject;
|
|
68365
68396
|
synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, false) : defaultContainingObject;
|
|
68366
68397
|
} else {
|
|
68367
68398
|
synthType.syntheticType = type;
|
|
@@ -68896,7 +68927,7 @@ function createTypeChecker(host) {
|
|
|
68896
68927
|
const symbol = createSymbol(0 /* None */, "NewTargetExpression");
|
|
68897
68928
|
const targetPropertySymbol = createSymbol(4 /* Property */, "target", 8 /* Readonly */);
|
|
68898
68929
|
targetPropertySymbol.parent = symbol;
|
|
68899
|
-
targetPropertySymbol.type = targetType;
|
|
68930
|
+
targetPropertySymbol.links.type = targetType;
|
|
68900
68931
|
const members = createSymbolTable([targetPropertySymbol]);
|
|
68901
68932
|
symbol.members = members;
|
|
68902
68933
|
return createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
@@ -74434,7 +74465,7 @@ function createTypeChecker(host) {
|
|
|
74434
74465
|
);
|
|
74435
74466
|
}
|
|
74436
74467
|
function getTargetSymbol(s) {
|
|
74437
|
-
return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s;
|
|
74468
|
+
return getCheckFlags(s) & 1 /* Instantiated */ ? s.links.target : s;
|
|
74438
74469
|
}
|
|
74439
74470
|
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
|
|
74440
74471
|
return filter(symbol.declarations, (d) => d.kind === 260 /* ClassDeclaration */ || d.kind === 261 /* InterfaceDeclaration */);
|
|
@@ -76497,7 +76528,7 @@ function createTypeChecker(host) {
|
|
|
76497
76528
|
if (getCheckFlags(symbol) & 6 /* Synthetic */) {
|
|
76498
76529
|
return mapDefined(getSymbolLinks(symbol).containingType.types, (type) => getPropertyOfType(type, symbol.escapedName));
|
|
76499
76530
|
} else if (symbol.flags & 33554432 /* Transient */) {
|
|
76500
|
-
const { leftSpread, rightSpread, syntheticOrigin } = symbol;
|
|
76531
|
+
const { links: { leftSpread, rightSpread, syntheticOrigin } } = symbol;
|
|
76501
76532
|
return leftSpread ? [leftSpread, rightSpread] : syntheticOrigin ? [syntheticOrigin] : singleElementArray(tryGetTarget(symbol));
|
|
76502
76533
|
}
|
|
76503
76534
|
return void 0;
|
|
@@ -83907,7 +83938,7 @@ function transformClassFields(context) {
|
|
|
83907
83938
|
if (isClassWithConstructorReference) {
|
|
83908
83939
|
enableSubstitutionForClassAliases();
|
|
83909
83940
|
const alias = factory2.cloneNode(temp);
|
|
83910
|
-
alias.
|
|
83941
|
+
alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
|
|
83911
83942
|
classAliases[getOriginalNodeId(node)] = alias;
|
|
83912
83943
|
}
|
|
83913
83944
|
setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression));
|
|
@@ -94203,7 +94234,7 @@ function transformModule(context) {
|
|
|
94203
94234
|
return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
|
|
94204
94235
|
}
|
|
94205
94236
|
return node;
|
|
94206
|
-
} else if (!(isGeneratedIdentifier(node) && !(node.
|
|
94237
|
+
} else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
|
|
94207
94238
|
const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
|
|
94208
94239
|
if (exportContainer && exportContainer.kind === 308 /* SourceFile */) {
|
|
94209
94240
|
return setTextRange(
|
|
@@ -102058,10 +102089,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
102058
102089
|
}
|
|
102059
102090
|
}
|
|
102060
102091
|
function generateName(name) {
|
|
102061
|
-
if ((name.
|
|
102062
|
-
return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.
|
|
102092
|
+
if ((name.autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) {
|
|
102093
|
+
return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerate.flags, name.autoGenerate.prefix, name.autoGenerate.suffix);
|
|
102063
102094
|
} else {
|
|
102064
|
-
const autoGenerateId = name.
|
|
102095
|
+
const autoGenerateId = name.autoGenerate.id;
|
|
102065
102096
|
return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name));
|
|
102066
102097
|
}
|
|
102067
102098
|
}
|
|
@@ -102244,26 +102275,26 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
102244
102275
|
}
|
|
102245
102276
|
}
|
|
102246
102277
|
function makeName(name) {
|
|
102247
|
-
const prefix = formatGeneratedNamePart(name.
|
|
102248
|
-
const suffix = formatGeneratedNamePart(name.
|
|
102249
|
-
switch (name.
|
|
102278
|
+
const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName);
|
|
102279
|
+
const suffix = formatGeneratedNamePart(name.autoGenerate.suffix);
|
|
102280
|
+
switch (name.autoGenerate.flags & 7 /* KindMask */) {
|
|
102250
102281
|
case 1 /* Auto */:
|
|
102251
|
-
return makeTempVariableName(TempFlags.Auto, !!(name.
|
|
102282
|
+
return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
|
|
102252
102283
|
case 2 /* Loop */:
|
|
102253
102284
|
Debug.assertNode(name, isIdentifier);
|
|
102254
|
-
return makeTempVariableName(TempFlags._i, !!(name.
|
|
102285
|
+
return makeTempVariableName(TempFlags._i, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), false, prefix, suffix);
|
|
102255
102286
|
case 3 /* Unique */:
|
|
102256
102287
|
return makeUniqueName2(
|
|
102257
102288
|
idText(name),
|
|
102258
|
-
name.
|
|
102259
|
-
!!(name.
|
|
102260
|
-
!!(name.
|
|
102289
|
+
name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
|
|
102290
|
+
!!(name.autoGenerate.flags & 16 /* Optimistic */),
|
|
102291
|
+
!!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */),
|
|
102261
102292
|
isPrivateIdentifier(name),
|
|
102262
102293
|
prefix,
|
|
102263
102294
|
suffix
|
|
102264
102295
|
);
|
|
102265
102296
|
}
|
|
102266
|
-
return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(name.
|
|
102297
|
+
return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(name.autoGenerate.flags & 7 /* KindMask */, GeneratedIdentifierFlags, true)}.`);
|
|
102267
102298
|
}
|
|
102268
102299
|
function pipelineEmitWithComments(hint, node) {
|
|
102269
102300
|
const pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node);
|
|
@@ -103906,19 +103937,20 @@ function shouldProgramCreateNewSourceFiles(program, newOptions) {
|
|
|
103906
103937
|
return false;
|
|
103907
103938
|
return optionsHaveChanges(program.getCompilerOptions(), newOptions, sourceFileAffectingCompilerOptions);
|
|
103908
103939
|
}
|
|
103909
|
-
function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics) {
|
|
103940
|
+
function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics, typeScriptVersion3) {
|
|
103910
103941
|
return {
|
|
103911
103942
|
rootNames,
|
|
103912
103943
|
options,
|
|
103913
103944
|
host,
|
|
103914
103945
|
oldProgram,
|
|
103915
|
-
configFileParsingDiagnostics
|
|
103946
|
+
configFileParsingDiagnostics,
|
|
103947
|
+
typeScriptVersion: typeScriptVersion3
|
|
103916
103948
|
};
|
|
103917
103949
|
}
|
|
103918
103950
|
function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
|
|
103919
103951
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
103920
103952
|
const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
|
|
103921
|
-
const { rootNames, options, configFileParsingDiagnostics, projectReferences } = createProgramOptions;
|
|
103953
|
+
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions;
|
|
103922
103954
|
let { oldProgram } = createProgramOptions;
|
|
103923
103955
|
let processingDefaultLibFiles;
|
|
103924
103956
|
let processingOtherFiles;
|
|
@@ -105677,7 +105709,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
105677
105709
|
i++;
|
|
105678
105710
|
}
|
|
105679
105711
|
const resolveFrom = combinePaths(currentDirectory, `__lib_node_modules_lookup_${libFileName}__.ts`);
|
|
105680
|
-
const localOverrideModuleResult = resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: 2 /*
|
|
105712
|
+
const localOverrideModuleResult = resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: 2 /* Node10 */ }, host, moduleResolutionCache);
|
|
105681
105713
|
if (localOverrideModuleResult == null ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
105682
105714
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
105683
105715
|
}
|
|
@@ -105850,6 +105882,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
105850
105882
|
} else if (options.incremental && !outputFile && !options.configFilePath) {
|
|
105851
105883
|
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
|
|
105852
105884
|
}
|
|
105885
|
+
verifyDeprecatedCompilerOptions();
|
|
105853
105886
|
verifyProjectReferences();
|
|
105854
105887
|
if (options.composite) {
|
|
105855
105888
|
const rootPaths = new Set(rootNames.map(toPath3));
|
|
@@ -105960,8 +105993,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
105960
105993
|
}
|
|
105961
105994
|
}
|
|
105962
105995
|
if (getResolveJsonModule(options)) {
|
|
105963
|
-
if (getEmitModuleResolutionKind(options)
|
|
105964
|
-
createDiagnosticForOptionName(Diagnostics.
|
|
105996
|
+
if (getEmitModuleResolutionKind(options) === 1 /* Classic */) {
|
|
105997
|
+
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic, "resolveJsonModule");
|
|
105965
105998
|
} else if (!hasJsonModuleEmitEnabled(options)) {
|
|
105966
105999
|
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext, "resolveJsonModule", "module");
|
|
105967
106000
|
}
|
|
@@ -106069,6 +106102,56 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
106069
106102
|
}
|
|
106070
106103
|
}
|
|
106071
106104
|
}
|
|
106105
|
+
function verifyDeprecatedCompilerOptions() {
|
|
106106
|
+
const version2 = typeScriptVersion3 || versionMajorMinor;
|
|
106107
|
+
const ignoreDeprecations = options.ignoreDeprecations;
|
|
106108
|
+
if (ignoreDeprecations) {
|
|
106109
|
+
if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) {
|
|
106110
|
+
return;
|
|
106111
|
+
} else {
|
|
106112
|
+
createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations);
|
|
106113
|
+
}
|
|
106114
|
+
}
|
|
106115
|
+
if (options.target === 0 /* ES3 */) {
|
|
106116
|
+
createDeprecatedDiagnosticForOption(version2, "target", "ES3");
|
|
106117
|
+
}
|
|
106118
|
+
if (options.noImplicitUseStrict) {
|
|
106119
|
+
createDeprecatedDiagnosticForOption(version2, "noImplicitUseStrict");
|
|
106120
|
+
}
|
|
106121
|
+
if (options.keyofStringsOnly) {
|
|
106122
|
+
createDeprecatedDiagnosticForOption(version2, "keyofStringsOnly");
|
|
106123
|
+
}
|
|
106124
|
+
if (options.suppressExcessPropertyErrors) {
|
|
106125
|
+
createDeprecatedDiagnosticForOption(version2, "suppressExcessPropertyErrors");
|
|
106126
|
+
}
|
|
106127
|
+
if (options.suppressImplicitAnyIndexErrors) {
|
|
106128
|
+
createDeprecatedDiagnosticForOption(version2, "suppressImplicitAnyIndexErrors");
|
|
106129
|
+
}
|
|
106130
|
+
if (options.noStrictGenericChecks) {
|
|
106131
|
+
createDeprecatedDiagnosticForOption(version2, "noStrictGenericChecks");
|
|
106132
|
+
}
|
|
106133
|
+
if (options.charset) {
|
|
106134
|
+
createDeprecatedDiagnosticForOption(version2, "charset");
|
|
106135
|
+
}
|
|
106136
|
+
if (options.out) {
|
|
106137
|
+
createDeprecatedDiagnosticForOption(version2, "out");
|
|
106138
|
+
}
|
|
106139
|
+
}
|
|
106140
|
+
function createDeprecatedDiagnosticForOption(version2, name, value) {
|
|
106141
|
+
if (version2 === "6.0" /* v6_0 */) {
|
|
106142
|
+
createDiagnosticForOption(!value, name, void 0, Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name);
|
|
106143
|
+
} else {
|
|
106144
|
+
createDiagnosticForOption(
|
|
106145
|
+
!value,
|
|
106146
|
+
name,
|
|
106147
|
+
void 0,
|
|
106148
|
+
Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error,
|
|
106149
|
+
value || name,
|
|
106150
|
+
"5.5" /* v5_5 */,
|
|
106151
|
+
"5.0" /* v5_0 */
|
|
106152
|
+
);
|
|
106153
|
+
}
|
|
106154
|
+
}
|
|
106072
106155
|
function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
|
|
106073
106156
|
var _a3;
|
|
106074
106157
|
let fileIncludeReasons;
|
|
@@ -112629,6 +112712,7 @@ __export(ts_exports3, {
|
|
|
112629
112712
|
ContextFlags: () => ContextFlags,
|
|
112630
112713
|
CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
|
|
112631
112714
|
Debug: () => Debug,
|
|
112715
|
+
DeprecationVersion: () => DeprecationVersion,
|
|
112632
112716
|
DiagnosticCategory: () => DiagnosticCategory,
|
|
112633
112717
|
Diagnostics: () => Diagnostics,
|
|
112634
112718
|
DocumentHighlights: () => DocumentHighlights,
|
|
@@ -116822,7 +116906,7 @@ function getModuleSpecifierResolverHost(program, host) {
|
|
|
116822
116906
|
};
|
|
116823
116907
|
}
|
|
116824
116908
|
function moduleResolutionUsesNodeModules(moduleResolution) {
|
|
116825
|
-
return moduleResolution === 2 /*
|
|
116909
|
+
return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */;
|
|
116826
116910
|
}
|
|
116827
116911
|
function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) {
|
|
116828
116912
|
return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0;
|
|
@@ -117282,18 +117366,15 @@ function getScriptKind(fileName, host) {
|
|
|
117282
117366
|
}
|
|
117283
117367
|
function getSymbolTarget(symbol, checker) {
|
|
117284
117368
|
let next = symbol;
|
|
117285
|
-
while (isAliasSymbol(next) ||
|
|
117286
|
-
if (
|
|
117287
|
-
next = next.target;
|
|
117369
|
+
while (isAliasSymbol(next) || isTransientSymbol(next) && next.links.target) {
|
|
117370
|
+
if (isTransientSymbol(next) && next.links.target) {
|
|
117371
|
+
next = next.links.target;
|
|
117288
117372
|
} else {
|
|
117289
117373
|
next = skipAlias(next, checker);
|
|
117290
117374
|
}
|
|
117291
117375
|
}
|
|
117292
117376
|
return next;
|
|
117293
117377
|
}
|
|
117294
|
-
function isTransientSymbol2(symbol) {
|
|
117295
|
-
return (symbol.flags & 33554432 /* Transient */) !== 0;
|
|
117296
|
-
}
|
|
117297
117378
|
function isAliasSymbol(symbol) {
|
|
117298
117379
|
return (symbol.flags & 2097152 /* Alias */) !== 0;
|
|
117299
117380
|
}
|
|
@@ -122066,6 +122147,8 @@ var TokenOrIdentifierObject = class {
|
|
|
122066
122147
|
};
|
|
122067
122148
|
var SymbolObject = class {
|
|
122068
122149
|
constructor(flags, name) {
|
|
122150
|
+
this.id = 0;
|
|
122151
|
+
this.mergeId = 0;
|
|
122069
122152
|
this.flags = flags;
|
|
122070
122153
|
this.escapedName = name;
|
|
122071
122154
|
}
|
|
@@ -122087,8 +122170,8 @@ var SymbolObject = class {
|
|
|
122087
122170
|
getDocumentationComment(checker) {
|
|
122088
122171
|
if (!this.documentationComment) {
|
|
122089
122172
|
this.documentationComment = emptyArray;
|
|
122090
|
-
if (!this.declarations && this.target && this.target.tupleLabelDeclaration) {
|
|
122091
|
-
const labelDecl = this.target.tupleLabelDeclaration;
|
|
122173
|
+
if (!this.declarations && isTransientSymbol(this) && this.links.target && isTransientSymbol(this.links.target) && this.links.target.links.tupleLabelDeclaration) {
|
|
122174
|
+
const labelDecl = this.links.target.links.tupleLabelDeclaration;
|
|
122092
122175
|
this.documentationComment = getDocumentationComment([labelDecl], checker);
|
|
122093
122176
|
} else {
|
|
122094
122177
|
this.documentationComment = getDocumentationComment(this.declarations, checker);
|
|
@@ -128841,7 +128924,7 @@ function compareModuleSpecifiers(a, b, importingFile, program, allowsImportingSp
|
|
|
128841
128924
|
}
|
|
128842
128925
|
function isFixPossiblyReExportingImportingFile(fix, importingFile, compilerOptions, toPath3) {
|
|
128843
128926
|
var _a2;
|
|
128844
|
-
if (fix.isReExport && ((_a2 = fix.exportInfo) == null ? void 0 : _a2.moduleFileName) && getEmitModuleResolutionKind(compilerOptions) === 2 /*
|
|
128927
|
+
if (fix.isReExport && ((_a2 = fix.exportInfo) == null ? void 0 : _a2.moduleFileName) && getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */ && isIndexFileName(fix.exportInfo.moduleFileName)) {
|
|
128845
128928
|
const reExportDir = toPath3(getDirectoryPath(fix.exportInfo.moduleFileName));
|
|
128846
128929
|
return startsWith(importingFile.path, reExportDir);
|
|
128847
128930
|
}
|
|
@@ -129989,7 +130072,7 @@ registerCodeFix({
|
|
|
129989
130072
|
});
|
|
129990
130073
|
function createObjectTypeFromLabeledExpression(checker, label, expression) {
|
|
129991
130074
|
const member = checker.createSymbol(4 /* Property */, label.escapedText);
|
|
129992
|
-
member.type = checker.getTypeAtLocation(expression);
|
|
130075
|
+
member.links.type = checker.getTypeAtLocation(expression);
|
|
129993
130076
|
const members = createSymbolTable([member]);
|
|
129994
130077
|
return checker.createAnonymousType(void 0, members, [], [], []);
|
|
129995
130078
|
}
|
|
@@ -132603,7 +132686,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
|
|
|
132603
132686
|
const members = mapEntries(props, (name, types) => {
|
|
132604
132687
|
const isOptional = types.length < anons.length ? 16777216 /* Optional */ : 0;
|
|
132605
132688
|
const s = checker.createSymbol(4 /* Property */ | isOptional, name);
|
|
132606
|
-
s.type = checker.getUnionType(types);
|
|
132689
|
+
s.links.type = checker.getUnionType(types);
|
|
132607
132690
|
return [name, s];
|
|
132608
132691
|
});
|
|
132609
132692
|
const indexInfos = [];
|
|
@@ -132657,7 +132740,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
|
|
|
132657
132740
|
if (usage.properties) {
|
|
132658
132741
|
usage.properties.forEach((u, name) => {
|
|
132659
132742
|
const symbol = checker.createSymbol(4 /* Property */, name);
|
|
132660
|
-
symbol.type = combineFromUsage(u);
|
|
132743
|
+
symbol.links.type = combineFromUsage(u);
|
|
132661
132744
|
members.set(name, symbol);
|
|
132662
132745
|
});
|
|
132663
132746
|
}
|
|
@@ -132733,6 +132816,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
|
|
|
132733
132816
|
return [];
|
|
132734
132817
|
}
|
|
132735
132818
|
function inferFromSignatures(genericSig, usageSig, typeParameter) {
|
|
132819
|
+
var _a2;
|
|
132736
132820
|
const types = [];
|
|
132737
132821
|
for (let i = 0; i < genericSig.parameters.length; i++) {
|
|
132738
132822
|
const genericParam = genericSig.parameters[i];
|
|
@@ -132746,7 +132830,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
|
|
|
132746
132830
|
if (elementType) {
|
|
132747
132831
|
genericParamType = elementType;
|
|
132748
132832
|
}
|
|
132749
|
-
const targetType = usageParam.type || (usageParam.valueDeclaration ? checker.getTypeOfSymbolAtLocation(usageParam, usageParam.valueDeclaration) : checker.getAnyType());
|
|
132833
|
+
const targetType = ((_a2 = tryCast(usageParam, isTransientSymbol)) == null ? void 0 : _a2.links.type) || (usageParam.valueDeclaration ? checker.getTypeOfSymbolAtLocation(usageParam, usageParam.valueDeclaration) : checker.getAnyType());
|
|
132750
132834
|
types.push(...inferTypeParameters(genericParamType, targetType, typeParameter));
|
|
132751
132835
|
}
|
|
132752
132836
|
const genericReturn = checker.getReturnTypeOfSignature(genericSig);
|
|
@@ -132762,7 +132846,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
|
|
|
132762
132846
|
const length2 = Math.max(...calls.map((c) => c.argumentTypes.length));
|
|
132763
132847
|
for (let i = 0; i < length2; i++) {
|
|
132764
132848
|
const symbol = checker.createSymbol(1 /* FunctionScopedVariable */, escapeLeadingUnderscores(`arg${i}`));
|
|
132765
|
-
symbol.type = combineTypes(calls.map((call) => call.argumentTypes[i] || checker.getUndefinedType()));
|
|
132849
|
+
symbol.links.type = combineTypes(calls.map((call) => call.argumentTypes[i] || checker.getUndefinedType()));
|
|
132766
132850
|
if (calls.some((call) => call.argumentTypes[i] === void 0)) {
|
|
132767
132851
|
symbol.flags |= 16777216 /* Optional */;
|
|
132768
132852
|
}
|
|
@@ -133694,11 +133778,11 @@ function getActionsForInvalidImportLocation(context) {
|
|
|
133694
133778
|
}
|
|
133695
133779
|
function getImportCodeFixesForExpression(context, expr) {
|
|
133696
133780
|
const type = context.program.getTypeChecker().getTypeAtLocation(expr);
|
|
133697
|
-
if (!(type.symbol && type.symbol.originatingImport)) {
|
|
133781
|
+
if (!(type.symbol && isTransientSymbol(type.symbol) && type.symbol.links.originatingImport)) {
|
|
133698
133782
|
return [];
|
|
133699
133783
|
}
|
|
133700
133784
|
const fixes = [];
|
|
133701
|
-
const relatedImport = type.symbol.originatingImport;
|
|
133785
|
+
const relatedImport = type.symbol.links.originatingImport;
|
|
133702
133786
|
if (!isImportCall(relatedImport)) {
|
|
133703
133787
|
addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport));
|
|
133704
133788
|
}
|
|
@@ -147418,7 +147502,10 @@ function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration
|
|
|
147418
147502
|
}
|
|
147419
147503
|
});
|
|
147420
147504
|
const lists = checker.getExpandedParameters(candidateSignature);
|
|
147421
|
-
const isVariadic = !checker.hasEffectiveRestParameter(candidateSignature) ? (_) => false : lists.length === 1 ? (_) => true : (pList) =>
|
|
147505
|
+
const isVariadic = !checker.hasEffectiveRestParameter(candidateSignature) ? (_) => false : lists.length === 1 ? (_) => true : (pList) => {
|
|
147506
|
+
var _a2;
|
|
147507
|
+
return !!(pList.length && ((_a2 = tryCast(pList[pList.length - 1], isTransientSymbol)) == null ? void 0 : _a2.links.checkFlags) & 32768 /* RestParameter */);
|
|
147508
|
+
};
|
|
147422
147509
|
return lists.map((parameterList) => ({
|
|
147423
147510
|
isVariadic: isVariadic(parameterList),
|
|
147424
147511
|
parameters: parameterList.map((p) => createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer)),
|
|
@@ -147432,7 +147519,7 @@ function createSignatureHelpParameterForParameter(parameter, checker, enclosingD
|
|
|
147432
147519
|
printer.writeNode(4 /* Unspecified */, param, sourceFile, writer);
|
|
147433
147520
|
});
|
|
147434
147521
|
const isOptional = checker.isOptionalParameter(parameter.valueDeclaration);
|
|
147435
|
-
const isRest = !!(parameter.checkFlags & 32768 /* RestParameter */);
|
|
147522
|
+
const isRest = isTransientSymbol(parameter) && !!(parameter.links.checkFlags & 32768 /* RestParameter */);
|
|
147436
147523
|
return { name: parameter.name, documentation: parameter.getDocumentationComment(checker), displayParts, isOptional, isRest };
|
|
147437
147524
|
}
|
|
147438
147525
|
function createSignatureHelpParameterForTypeParameter(typeParameter, checker, enclosingDeclaration, sourceFile, printer) {
|
|
@@ -147715,7 +147802,7 @@ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeCheck
|
|
|
147715
147802
|
if (flags & 131072 /* Signature */)
|
|
147716
147803
|
return "index" /* indexSignatureElement */;
|
|
147717
147804
|
if (flags & 4 /* Property */) {
|
|
147718
|
-
if (flags & 33554432 /* Transient */ && symbol.checkFlags & 6 /* Synthetic */) {
|
|
147805
|
+
if (flags & 33554432 /* Transient */ && symbol.links.checkFlags & 6 /* Synthetic */) {
|
|
147719
147806
|
const unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), (rootSymbol) => {
|
|
147720
147807
|
const rootSymbolFlags = rootSymbol.getFlags();
|
|
147721
147808
|
if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) {
|
|
@@ -148095,8 +148182,8 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
|
|
148095
148182
|
} else {
|
|
148096
148183
|
addRange(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration));
|
|
148097
148184
|
}
|
|
148098
|
-
if (symbol.target && symbol.target.tupleLabelDeclaration) {
|
|
148099
|
-
const labelDecl = symbol.target.tupleLabelDeclaration;
|
|
148185
|
+
if (isTransientSymbol(symbol) && symbol.links.target && isTransientSymbol(symbol.links.target) && symbol.links.target.links.tupleLabelDeclaration) {
|
|
148186
|
+
const labelDecl = symbol.links.target.links.tupleLabelDeclaration;
|
|
148100
148187
|
Debug.assertNode(labelDecl.name, isIdentifier);
|
|
148101
148188
|
displayParts.push(spacePart());
|
|
148102
148189
|
displayParts.push(punctuationPart(20 /* OpenParenToken */));
|
|
@@ -160514,7 +160601,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
160514
160601
|
return void 0;
|
|
160515
160602
|
const entrypoints = getEntrypointsFromPackageJsonInfo(
|
|
160516
160603
|
packageJson,
|
|
160517
|
-
{ moduleResolution: 2 /*
|
|
160604
|
+
{ moduleResolution: 2 /* Node10 */ },
|
|
160518
160605
|
project,
|
|
160519
160606
|
project.getModuleResolutionCache()
|
|
160520
160607
|
);
|
|
@@ -163393,6 +163480,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
163393
163480
|
ContextFlags,
|
|
163394
163481
|
CoreServicesShimHostAdapter,
|
|
163395
163482
|
Debug,
|
|
163483
|
+
DeprecationVersion,
|
|
163396
163484
|
DiagnosticCategory,
|
|
163397
163485
|
Diagnostics,
|
|
163398
163486
|
DocumentHighlights,
|