typescript 5.0.0-dev.20221214 → 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 +262 -173
- package/lib/tsserver.js +309 -208
- package/lib/tsserverlibrary.d.ts +2 -3
- package/lib/tsserverlibrary.js +310 -210
- package/lib/typescript.d.ts +2 -3
- package/lib/typescript.js +308 -209
- 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 */);
|
|
@@ -56555,6 +56585,13 @@ function createTypeChecker(host) {
|
|
|
56555
56585
|
if (meaning === 111551 /* Value */) {
|
|
56556
56586
|
return getTypeOfSymbol(symbol);
|
|
56557
56587
|
} else {
|
|
56588
|
+
const type = tryGetDeclaredTypeOfSymbol(resolvedSymbol);
|
|
56589
|
+
const typeParameters = type && getTypeParametersForTypeAndSymbol(type, resolvedSymbol);
|
|
56590
|
+
if (node.typeArguments && typeParameters) {
|
|
56591
|
+
addLazyDiagnostic(() => {
|
|
56592
|
+
checkTypeArgumentConstraints(node, typeParameters);
|
|
56593
|
+
});
|
|
56594
|
+
}
|
|
56558
56595
|
return getTypeReferenceType(node, resolvedSymbol);
|
|
56559
56596
|
}
|
|
56560
56597
|
}
|
|
@@ -56616,10 +56653,10 @@ function createTypeChecker(host) {
|
|
|
56616
56653
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
56617
56654
|
const flags = 4 /* Property */ | 16777216 /* Optional */;
|
|
56618
56655
|
const result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));
|
|
56619
|
-
result.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), true);
|
|
56656
|
+
result.links.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), true);
|
|
56620
56657
|
result.declarations = prop.declarations;
|
|
56621
|
-
result.nameType = getSymbolLinks(prop).nameType;
|
|
56622
|
-
result.syntheticOrigin = prop;
|
|
56658
|
+
result.links.nameType = getSymbolLinks(prop).nameType;
|
|
56659
|
+
result.links.syntheticOrigin = prop;
|
|
56623
56660
|
members.set(prop.escapedName, result);
|
|
56624
56661
|
}
|
|
56625
56662
|
}
|
|
@@ -56686,11 +56723,11 @@ function createTypeChecker(host) {
|
|
|
56686
56723
|
const declarations = concatenate(leftProp.declarations, rightProp.declarations);
|
|
56687
56724
|
const flags = 4 /* Property */ | leftProp.flags & 16777216 /* Optional */;
|
|
56688
56725
|
const result = createSymbol(flags, leftProp.escapedName);
|
|
56689
|
-
result.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], 2 /* Subtype */);
|
|
56690
|
-
result.leftSpread = leftProp;
|
|
56691
|
-
result.rightSpread = rightProp;
|
|
56726
|
+
result.links.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], 2 /* Subtype */);
|
|
56727
|
+
result.links.leftSpread = leftProp;
|
|
56728
|
+
result.links.rightSpread = rightProp;
|
|
56692
56729
|
result.declarations = declarations;
|
|
56693
|
-
result.nameType = getSymbolLinks(leftProp).nameType;
|
|
56730
|
+
result.links.nameType = getSymbolLinks(leftProp).nameType;
|
|
56694
56731
|
members.set(leftProp.escapedName, result);
|
|
56695
56732
|
}
|
|
56696
56733
|
} else {
|
|
@@ -56712,10 +56749,10 @@ function createTypeChecker(host) {
|
|
|
56712
56749
|
}
|
|
56713
56750
|
const flags = 4 /* Property */ | prop.flags & 16777216 /* Optional */;
|
|
56714
56751
|
const result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));
|
|
56715
|
-
result.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);
|
|
56752
|
+
result.links.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);
|
|
56716
56753
|
result.declarations = prop.declarations;
|
|
56717
|
-
result.nameType = getSymbolLinks(prop).nameType;
|
|
56718
|
-
result.syntheticOrigin = prop;
|
|
56754
|
+
result.links.nameType = getSymbolLinks(prop).nameType;
|
|
56755
|
+
result.links.syntheticOrigin = prop;
|
|
56719
56756
|
return result;
|
|
56720
56757
|
}
|
|
56721
56758
|
function getIndexInfoWithReadonly(info, readonly) {
|
|
@@ -57080,13 +57117,13 @@ function createTypeChecker(host) {
|
|
|
57080
57117
|
const result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | getCheckFlags(symbol) & (8 /* Readonly */ | 4096 /* Late */ | 16384 /* OptionalParameter */ | 32768 /* RestParameter */));
|
|
57081
57118
|
result.declarations = symbol.declarations;
|
|
57082
57119
|
result.parent = symbol.parent;
|
|
57083
|
-
result.target = symbol;
|
|
57084
|
-
result.mapper = mapper;
|
|
57120
|
+
result.links.target = symbol;
|
|
57121
|
+
result.links.mapper = mapper;
|
|
57085
57122
|
if (symbol.valueDeclaration) {
|
|
57086
57123
|
result.valueDeclaration = symbol.valueDeclaration;
|
|
57087
57124
|
}
|
|
57088
57125
|
if (links.nameType) {
|
|
57089
|
-
result.nameType = links.nameType;
|
|
57126
|
+
result.links.nameType = links.nameType;
|
|
57090
57127
|
}
|
|
57091
57128
|
return result;
|
|
57092
57129
|
}
|
|
@@ -60124,7 +60161,7 @@ function createTypeChecker(host) {
|
|
|
60124
60161
|
}
|
|
60125
60162
|
function forEachProperty2(prop, callback) {
|
|
60126
60163
|
if (getCheckFlags(prop) & 6 /* Synthetic */) {
|
|
60127
|
-
for (const t of prop.containingType.types) {
|
|
60164
|
+
for (const t of prop.links.containingType.types) {
|
|
60128
60165
|
const p = getPropertyOfType(t, prop.escapedName);
|
|
60129
60166
|
const result = p && forEachProperty2(p, callback);
|
|
60130
60167
|
if (result) {
|
|
@@ -60538,14 +60575,14 @@ function createTypeChecker(host) {
|
|
|
60538
60575
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
60539
60576
|
symbol.declarations = source.declarations;
|
|
60540
60577
|
symbol.parent = source.parent;
|
|
60541
|
-
symbol.type = type;
|
|
60542
|
-
symbol.target = source;
|
|
60578
|
+
symbol.links.type = type;
|
|
60579
|
+
symbol.links.target = source;
|
|
60543
60580
|
if (source.valueDeclaration) {
|
|
60544
60581
|
symbol.valueDeclaration = source.valueDeclaration;
|
|
60545
60582
|
}
|
|
60546
60583
|
const nameType = getSymbolLinks(source).nameType;
|
|
60547
60584
|
if (nameType) {
|
|
60548
|
-
symbol.nameType = nameType;
|
|
60585
|
+
symbol.links.nameType = nameType;
|
|
60549
60586
|
}
|
|
60550
60587
|
return symbol;
|
|
60551
60588
|
}
|
|
@@ -60926,7 +60963,7 @@ function createTypeChecker(host) {
|
|
|
60926
60963
|
}
|
|
60927
60964
|
const name = escapeLeadingUnderscores(t.value);
|
|
60928
60965
|
const literalProp = createSymbol(4 /* Property */, name);
|
|
60929
|
-
literalProp.type = anyType;
|
|
60966
|
+
literalProp.links.type = anyType;
|
|
60930
60967
|
if (t.symbol) {
|
|
60931
60968
|
literalProp.declarations = t.symbol.declarations;
|
|
60932
60969
|
literalProp.valueDeclaration = t.symbol.valueDeclaration;
|
|
@@ -60974,7 +61011,7 @@ function createTypeChecker(host) {
|
|
|
60974
61011
|
function getTypeOfReverseMappedSymbol(symbol) {
|
|
60975
61012
|
const links = getSymbolLinks(symbol);
|
|
60976
61013
|
if (!links.type) {
|
|
60977
|
-
links.type = inferReverseMappedType(symbol.propertyType, symbol.mappedType, symbol.constraintType);
|
|
61014
|
+
links.type = inferReverseMappedType(symbol.links.propertyType, symbol.links.mappedType, symbol.links.constraintType);
|
|
60978
61015
|
}
|
|
60979
61016
|
return links.type;
|
|
60980
61017
|
}
|
|
@@ -61957,10 +61994,10 @@ function createTypeChecker(host) {
|
|
|
61957
61994
|
if (type && type.flags & 1048576 /* Union */) {
|
|
61958
61995
|
const prop = getUnionOrIntersectionProperty(type, name);
|
|
61959
61996
|
if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) {
|
|
61960
|
-
if (prop.isDiscriminantProperty === void 0) {
|
|
61961
|
-
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));
|
|
61962
61999
|
}
|
|
61963
|
-
return !!prop.isDiscriminantProperty;
|
|
62000
|
+
return !!prop.links.isDiscriminantProperty;
|
|
61964
62001
|
}
|
|
61965
62002
|
}
|
|
61966
62003
|
return false;
|
|
@@ -62482,7 +62519,7 @@ function createTypeChecker(host) {
|
|
|
62482
62519
|
}
|
|
62483
62520
|
if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {
|
|
62484
62521
|
if (getCheckFlags(symbol) & 262144 /* Mapped */) {
|
|
62485
|
-
const origin = symbol.syntheticOrigin;
|
|
62522
|
+
const origin = symbol.links.syntheticOrigin;
|
|
62486
62523
|
if (origin && getExplicitTypeOfSymbol(origin)) {
|
|
62487
62524
|
return getTypeOfSymbol(symbol);
|
|
62488
62525
|
}
|
|
@@ -64563,7 +64600,7 @@ function createTypeChecker(host) {
|
|
|
64563
64600
|
return nameStr !== void 0 && getTypeOfPropertyOfContextualType(thisType, nameStr) || void 0;
|
|
64564
64601
|
}
|
|
64565
64602
|
function isCircularMappedProperty(symbol) {
|
|
64566
|
-
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);
|
|
64567
64604
|
}
|
|
64568
64605
|
function getTypeOfPropertyOfContextualType(type, name, nameType) {
|
|
64569
64606
|
return mapType(type, (t) => {
|
|
@@ -64985,14 +65022,14 @@ function createTypeChecker(host) {
|
|
|
64985
65022
|
1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0),
|
|
64986
65023
|
paramName || `arg${i}`
|
|
64987
65024
|
);
|
|
64988
|
-
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
65025
|
+
paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
64989
65026
|
params[i] = paramSymbol;
|
|
64990
65027
|
}
|
|
64991
65028
|
if (needsExtraRestElement) {
|
|
64992
65029
|
const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args");
|
|
64993
|
-
restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
65030
|
+
restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
64994
65031
|
if (shorter === right) {
|
|
64995
|
-
restParamSymbol.type = instantiateType(restParamSymbol.type, mapper);
|
|
65032
|
+
restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper);
|
|
64996
65033
|
}
|
|
64997
65034
|
params[longestCount] = restParamSymbol;
|
|
64998
65035
|
}
|
|
@@ -65223,6 +65260,7 @@ function createTypeChecker(host) {
|
|
|
65223
65260
|
return links.immediateTarget;
|
|
65224
65261
|
}
|
|
65225
65262
|
function checkObjectLiteral(node, checkMode) {
|
|
65263
|
+
var _a2;
|
|
65226
65264
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
65227
65265
|
checkGrammarObjectLiteralExpression(node, inDestructuringPattern);
|
|
65228
65266
|
const allPropertiesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
@@ -65265,7 +65303,7 @@ function createTypeChecker(host) {
|
|
|
65265
65303
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
65266
65304
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
65267
65305
|
if (nameType) {
|
|
65268
|
-
prop.nameType = nameType;
|
|
65306
|
+
prop.links.nameType = nameType;
|
|
65269
65307
|
}
|
|
65270
65308
|
if (inDestructuringPattern) {
|
|
65271
65309
|
const isOptional = memberDecl.kind === 299 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 300 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
|
|
@@ -65290,8 +65328,8 @@ function createTypeChecker(host) {
|
|
|
65290
65328
|
if (member.valueDeclaration) {
|
|
65291
65329
|
prop.valueDeclaration = member.valueDeclaration;
|
|
65292
65330
|
}
|
|
65293
|
-
prop.type = type;
|
|
65294
|
-
prop.target = member;
|
|
65331
|
+
prop.links.type = type;
|
|
65332
|
+
prop.links.target = member;
|
|
65295
65333
|
member = prop;
|
|
65296
65334
|
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
65297
65335
|
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 299 /* PropertyAssignment */ || memberDecl.kind === 171 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
|
|
@@ -65364,7 +65402,7 @@ function createTypeChecker(host) {
|
|
|
65364
65402
|
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
|
|
65365
65403
|
if (!(prop.flags & 16777216 /* Optional */)) {
|
|
65366
65404
|
error(
|
|
65367
|
-
prop.valueDeclaration || prop.bindingElement,
|
|
65405
|
+
prop.valueDeclaration || ((_a2 = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a2.links.bindingElement),
|
|
65368
65406
|
Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value
|
|
65369
65407
|
);
|
|
65370
65408
|
}
|
|
@@ -65474,8 +65512,8 @@ function createTypeChecker(host) {
|
|
|
65474
65512
|
if (member.valueDeclaration) {
|
|
65475
65513
|
attributeSymbol.valueDeclaration = member.valueDeclaration;
|
|
65476
65514
|
}
|
|
65477
|
-
attributeSymbol.type = exprType;
|
|
65478
|
-
attributeSymbol.target = member;
|
|
65515
|
+
attributeSymbol.links.type = exprType;
|
|
65516
|
+
attributeSymbol.links.target = member;
|
|
65479
65517
|
attributesTable.set(attributeSymbol.escapedName, attributeSymbol);
|
|
65480
65518
|
allAttributesTable == null ? void 0 : allAttributesTable.set(attributeSymbol.escapedName, attributeSymbol);
|
|
65481
65519
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
@@ -65523,7 +65561,7 @@ function createTypeChecker(host) {
|
|
|
65523
65561
|
const contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes, void 0);
|
|
65524
65562
|
const childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName);
|
|
65525
65563
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
65526
|
-
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));
|
|
65527
65565
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(void 0, unescapeLeadingUnderscores(jsxChildrenPropertyName), void 0, void 0);
|
|
65528
65566
|
setParent(childrenPropSymbol.valueDeclaration, attributes);
|
|
65529
65567
|
childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol;
|
|
@@ -65629,7 +65667,7 @@ function createTypeChecker(host) {
|
|
|
65629
65667
|
return void 0;
|
|
65630
65668
|
}
|
|
65631
65669
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
65632
|
-
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;
|
|
65633
65671
|
const mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location);
|
|
65634
65672
|
const result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : void 0;
|
|
65635
65673
|
if (links) {
|
|
@@ -68034,7 +68072,7 @@ function createTypeChecker(host) {
|
|
|
68034
68072
|
returnNode ? factory.createTypeReferenceNode(returnNode, void 0) : factory.createKeywordTypeNode(131 /* AnyKeyword */)
|
|
68035
68073
|
);
|
|
68036
68074
|
const parameterSymbol = createSymbol(1 /* FunctionScopedVariable */, "props");
|
|
68037
|
-
parameterSymbol.type = result;
|
|
68075
|
+
parameterSymbol.links.type = result;
|
|
68038
68076
|
return createSignature(
|
|
68039
68077
|
declaration,
|
|
68040
68078
|
void 0,
|
|
@@ -68327,8 +68365,8 @@ function createTypeChecker(host) {
|
|
|
68327
68365
|
const memberTable = createSymbolTable();
|
|
68328
68366
|
const newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */);
|
|
68329
68367
|
newSymbol.parent = originalSymbol;
|
|
68330
|
-
newSymbol.nameType = getStringLiteralType("default");
|
|
68331
|
-
newSymbol.aliasTarget = resolveSymbol(symbol);
|
|
68368
|
+
newSymbol.links.nameType = getStringLiteralType("default");
|
|
68369
|
+
newSymbol.links.aliasTarget = resolveSymbol(symbol);
|
|
68332
68370
|
memberTable.set("default" /* Default */, newSymbol);
|
|
68333
68371
|
return createAnonymousType(anonymousSymbol, memberTable, emptyArray, emptyArray, emptyArray);
|
|
68334
68372
|
}
|
|
@@ -68354,7 +68392,7 @@ function createTypeChecker(host) {
|
|
|
68354
68392
|
if (hasSyntheticDefault) {
|
|
68355
68393
|
const anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
68356
68394
|
const defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol);
|
|
68357
|
-
anonymousSymbol.type = defaultContainingObject;
|
|
68395
|
+
anonymousSymbol.links.type = defaultContainingObject;
|
|
68358
68396
|
synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, false) : defaultContainingObject;
|
|
68359
68397
|
} else {
|
|
68360
68398
|
synthType.syntheticType = type;
|
|
@@ -68889,7 +68927,7 @@ function createTypeChecker(host) {
|
|
|
68889
68927
|
const symbol = createSymbol(0 /* None */, "NewTargetExpression");
|
|
68890
68928
|
const targetPropertySymbol = createSymbol(4 /* Property */, "target", 8 /* Readonly */);
|
|
68891
68929
|
targetPropertySymbol.parent = symbol;
|
|
68892
|
-
targetPropertySymbol.type = targetType;
|
|
68930
|
+
targetPropertySymbol.links.type = targetType;
|
|
68893
68931
|
const members = createSymbolTable([targetPropertySymbol]);
|
|
68894
68932
|
symbol.members = members;
|
|
68895
68933
|
return createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
@@ -71337,12 +71375,18 @@ function createTypeChecker(host) {
|
|
|
71337
71375
|
}
|
|
71338
71376
|
return result;
|
|
71339
71377
|
}
|
|
71378
|
+
function getTypeParametersForTypeAndSymbol(type, symbol) {
|
|
71379
|
+
if (!isErrorType(type)) {
|
|
71380
|
+
return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters || (getObjectFlags(type) & 4 /* Reference */ ? type.target.localTypeParameters : void 0);
|
|
71381
|
+
}
|
|
71382
|
+
return void 0;
|
|
71383
|
+
}
|
|
71340
71384
|
function getTypeParametersForTypeReference(node) {
|
|
71341
71385
|
const type = getTypeFromTypeReference(node);
|
|
71342
71386
|
if (!isErrorType(type)) {
|
|
71343
71387
|
const symbol = getNodeLinks(node).resolvedSymbol;
|
|
71344
71388
|
if (symbol) {
|
|
71345
|
-
return
|
|
71389
|
+
return getTypeParametersForTypeAndSymbol(type, symbol);
|
|
71346
71390
|
}
|
|
71347
71391
|
}
|
|
71348
71392
|
return void 0;
|
|
@@ -74421,7 +74465,7 @@ function createTypeChecker(host) {
|
|
|
74421
74465
|
);
|
|
74422
74466
|
}
|
|
74423
74467
|
function getTargetSymbol(s) {
|
|
74424
|
-
return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s;
|
|
74468
|
+
return getCheckFlags(s) & 1 /* Instantiated */ ? s.links.target : s;
|
|
74425
74469
|
}
|
|
74426
74470
|
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
|
|
74427
74471
|
return filter(symbol.declarations, (d) => d.kind === 260 /* ClassDeclaration */ || d.kind === 261 /* InterfaceDeclaration */);
|
|
@@ -76484,7 +76528,7 @@ function createTypeChecker(host) {
|
|
|
76484
76528
|
if (getCheckFlags(symbol) & 6 /* Synthetic */) {
|
|
76485
76529
|
return mapDefined(getSymbolLinks(symbol).containingType.types, (type) => getPropertyOfType(type, symbol.escapedName));
|
|
76486
76530
|
} else if (symbol.flags & 33554432 /* Transient */) {
|
|
76487
|
-
const { leftSpread, rightSpread, syntheticOrigin } = symbol;
|
|
76531
|
+
const { links: { leftSpread, rightSpread, syntheticOrigin } } = symbol;
|
|
76488
76532
|
return leftSpread ? [leftSpread, rightSpread] : syntheticOrigin ? [syntheticOrigin] : singleElementArray(tryGetTarget(symbol));
|
|
76489
76533
|
}
|
|
76490
76534
|
return void 0;
|
|
@@ -83894,7 +83938,7 @@ function transformClassFields(context) {
|
|
|
83894
83938
|
if (isClassWithConstructorReference) {
|
|
83895
83939
|
enableSubstitutionForClassAliases();
|
|
83896
83940
|
const alias = factory2.cloneNode(temp);
|
|
83897
|
-
alias.
|
|
83941
|
+
alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
|
|
83898
83942
|
classAliases[getOriginalNodeId(node)] = alias;
|
|
83899
83943
|
}
|
|
83900
83944
|
setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression));
|
|
@@ -94190,7 +94234,7 @@ function transformModule(context) {
|
|
|
94190
94234
|
return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
|
|
94191
94235
|
}
|
|
94192
94236
|
return node;
|
|
94193
|
-
} else if (!(isGeneratedIdentifier(node) && !(node.
|
|
94237
|
+
} else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
|
|
94194
94238
|
const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
|
|
94195
94239
|
if (exportContainer && exportContainer.kind === 308 /* SourceFile */) {
|
|
94196
94240
|
return setTextRange(
|
|
@@ -102045,10 +102089,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
102045
102089
|
}
|
|
102046
102090
|
}
|
|
102047
102091
|
function generateName(name) {
|
|
102048
|
-
if ((name.
|
|
102049
|
-
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);
|
|
102050
102094
|
} else {
|
|
102051
|
-
const autoGenerateId = name.
|
|
102095
|
+
const autoGenerateId = name.autoGenerate.id;
|
|
102052
102096
|
return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name));
|
|
102053
102097
|
}
|
|
102054
102098
|
}
|
|
@@ -102231,26 +102275,26 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
102231
102275
|
}
|
|
102232
102276
|
}
|
|
102233
102277
|
function makeName(name) {
|
|
102234
|
-
const prefix = formatGeneratedNamePart(name.
|
|
102235
|
-
const suffix = formatGeneratedNamePart(name.
|
|
102236
|
-
switch (name.
|
|
102278
|
+
const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName);
|
|
102279
|
+
const suffix = formatGeneratedNamePart(name.autoGenerate.suffix);
|
|
102280
|
+
switch (name.autoGenerate.flags & 7 /* KindMask */) {
|
|
102237
102281
|
case 1 /* Auto */:
|
|
102238
|
-
return makeTempVariableName(TempFlags.Auto, !!(name.
|
|
102282
|
+
return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
|
|
102239
102283
|
case 2 /* Loop */:
|
|
102240
102284
|
Debug.assertNode(name, isIdentifier);
|
|
102241
|
-
return makeTempVariableName(TempFlags._i, !!(name.
|
|
102285
|
+
return makeTempVariableName(TempFlags._i, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), false, prefix, suffix);
|
|
102242
102286
|
case 3 /* Unique */:
|
|
102243
102287
|
return makeUniqueName2(
|
|
102244
102288
|
idText(name),
|
|
102245
|
-
name.
|
|
102246
|
-
!!(name.
|
|
102247
|
-
!!(name.
|
|
102289
|
+
name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
|
|
102290
|
+
!!(name.autoGenerate.flags & 16 /* Optimistic */),
|
|
102291
|
+
!!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */),
|
|
102248
102292
|
isPrivateIdentifier(name),
|
|
102249
102293
|
prefix,
|
|
102250
102294
|
suffix
|
|
102251
102295
|
);
|
|
102252
102296
|
}
|
|
102253
|
-
return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(name.
|
|
102297
|
+
return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(name.autoGenerate.flags & 7 /* KindMask */, GeneratedIdentifierFlags, true)}.`);
|
|
102254
102298
|
}
|
|
102255
102299
|
function pipelineEmitWithComments(hint, node) {
|
|
102256
102300
|
const pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node);
|
|
@@ -103893,19 +103937,20 @@ function shouldProgramCreateNewSourceFiles(program, newOptions) {
|
|
|
103893
103937
|
return false;
|
|
103894
103938
|
return optionsHaveChanges(program.getCompilerOptions(), newOptions, sourceFileAffectingCompilerOptions);
|
|
103895
103939
|
}
|
|
103896
|
-
function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics) {
|
|
103940
|
+
function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics, typeScriptVersion3) {
|
|
103897
103941
|
return {
|
|
103898
103942
|
rootNames,
|
|
103899
103943
|
options,
|
|
103900
103944
|
host,
|
|
103901
103945
|
oldProgram,
|
|
103902
|
-
configFileParsingDiagnostics
|
|
103946
|
+
configFileParsingDiagnostics,
|
|
103947
|
+
typeScriptVersion: typeScriptVersion3
|
|
103903
103948
|
};
|
|
103904
103949
|
}
|
|
103905
103950
|
function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
|
|
103906
103951
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
103907
103952
|
const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
|
|
103908
|
-
const { rootNames, options, configFileParsingDiagnostics, projectReferences } = createProgramOptions;
|
|
103953
|
+
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions;
|
|
103909
103954
|
let { oldProgram } = createProgramOptions;
|
|
103910
103955
|
let processingDefaultLibFiles;
|
|
103911
103956
|
let processingOtherFiles;
|
|
@@ -105664,7 +105709,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
105664
105709
|
i++;
|
|
105665
105710
|
}
|
|
105666
105711
|
const resolveFrom = combinePaths(currentDirectory, `__lib_node_modules_lookup_${libFileName}__.ts`);
|
|
105667
|
-
const localOverrideModuleResult = resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: 2 /*
|
|
105712
|
+
const localOverrideModuleResult = resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: 2 /* Node10 */ }, host, moduleResolutionCache);
|
|
105668
105713
|
if (localOverrideModuleResult == null ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
105669
105714
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
105670
105715
|
}
|
|
@@ -105837,6 +105882,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
105837
105882
|
} else if (options.incremental && !outputFile && !options.configFilePath) {
|
|
105838
105883
|
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
|
|
105839
105884
|
}
|
|
105885
|
+
verifyDeprecatedCompilerOptions();
|
|
105840
105886
|
verifyProjectReferences();
|
|
105841
105887
|
if (options.composite) {
|
|
105842
105888
|
const rootPaths = new Set(rootNames.map(toPath3));
|
|
@@ -105947,8 +105993,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
105947
105993
|
}
|
|
105948
105994
|
}
|
|
105949
105995
|
if (getResolveJsonModule(options)) {
|
|
105950
|
-
if (getEmitModuleResolutionKind(options)
|
|
105951
|
-
createDiagnosticForOptionName(Diagnostics.
|
|
105996
|
+
if (getEmitModuleResolutionKind(options) === 1 /* Classic */) {
|
|
105997
|
+
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic, "resolveJsonModule");
|
|
105952
105998
|
} else if (!hasJsonModuleEmitEnabled(options)) {
|
|
105953
105999
|
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext, "resolveJsonModule", "module");
|
|
105954
106000
|
}
|
|
@@ -106056,6 +106102,56 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
106056
106102
|
}
|
|
106057
106103
|
}
|
|
106058
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
|
+
}
|
|
106059
106155
|
function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
|
|
106060
106156
|
var _a3;
|
|
106061
106157
|
let fileIncludeReasons;
|
|
@@ -112616,6 +112712,7 @@ __export(ts_exports3, {
|
|
|
112616
112712
|
ContextFlags: () => ContextFlags,
|
|
112617
112713
|
CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
|
|
112618
112714
|
Debug: () => Debug,
|
|
112715
|
+
DeprecationVersion: () => DeprecationVersion,
|
|
112619
112716
|
DiagnosticCategory: () => DiagnosticCategory,
|
|
112620
112717
|
Diagnostics: () => Diagnostics,
|
|
112621
112718
|
DocumentHighlights: () => DocumentHighlights,
|
|
@@ -116809,7 +116906,7 @@ function getModuleSpecifierResolverHost(program, host) {
|
|
|
116809
116906
|
};
|
|
116810
116907
|
}
|
|
116811
116908
|
function moduleResolutionUsesNodeModules(moduleResolution) {
|
|
116812
|
-
return moduleResolution === 2 /*
|
|
116909
|
+
return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */;
|
|
116813
116910
|
}
|
|
116814
116911
|
function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) {
|
|
116815
116912
|
return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0;
|
|
@@ -117269,18 +117366,15 @@ function getScriptKind(fileName, host) {
|
|
|
117269
117366
|
}
|
|
117270
117367
|
function getSymbolTarget(symbol, checker) {
|
|
117271
117368
|
let next = symbol;
|
|
117272
|
-
while (isAliasSymbol(next) ||
|
|
117273
|
-
if (
|
|
117274
|
-
next = next.target;
|
|
117369
|
+
while (isAliasSymbol(next) || isTransientSymbol(next) && next.links.target) {
|
|
117370
|
+
if (isTransientSymbol(next) && next.links.target) {
|
|
117371
|
+
next = next.links.target;
|
|
117275
117372
|
} else {
|
|
117276
117373
|
next = skipAlias(next, checker);
|
|
117277
117374
|
}
|
|
117278
117375
|
}
|
|
117279
117376
|
return next;
|
|
117280
117377
|
}
|
|
117281
|
-
function isTransientSymbol2(symbol) {
|
|
117282
|
-
return (symbol.flags & 33554432 /* Transient */) !== 0;
|
|
117283
|
-
}
|
|
117284
117378
|
function isAliasSymbol(symbol) {
|
|
117285
117379
|
return (symbol.flags & 2097152 /* Alias */) !== 0;
|
|
117286
117380
|
}
|
|
@@ -122053,6 +122147,8 @@ var TokenOrIdentifierObject = class {
|
|
|
122053
122147
|
};
|
|
122054
122148
|
var SymbolObject = class {
|
|
122055
122149
|
constructor(flags, name) {
|
|
122150
|
+
this.id = 0;
|
|
122151
|
+
this.mergeId = 0;
|
|
122056
122152
|
this.flags = flags;
|
|
122057
122153
|
this.escapedName = name;
|
|
122058
122154
|
}
|
|
@@ -122074,8 +122170,8 @@ var SymbolObject = class {
|
|
|
122074
122170
|
getDocumentationComment(checker) {
|
|
122075
122171
|
if (!this.documentationComment) {
|
|
122076
122172
|
this.documentationComment = emptyArray;
|
|
122077
|
-
if (!this.declarations && this.target && this.target.tupleLabelDeclaration) {
|
|
122078
|
-
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;
|
|
122079
122175
|
this.documentationComment = getDocumentationComment([labelDecl], checker);
|
|
122080
122176
|
} else {
|
|
122081
122177
|
this.documentationComment = getDocumentationComment(this.declarations, checker);
|
|
@@ -128828,7 +128924,7 @@ function compareModuleSpecifiers(a, b, importingFile, program, allowsImportingSp
|
|
|
128828
128924
|
}
|
|
128829
128925
|
function isFixPossiblyReExportingImportingFile(fix, importingFile, compilerOptions, toPath3) {
|
|
128830
128926
|
var _a2;
|
|
128831
|
-
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)) {
|
|
128832
128928
|
const reExportDir = toPath3(getDirectoryPath(fix.exportInfo.moduleFileName));
|
|
128833
128929
|
return startsWith(importingFile.path, reExportDir);
|
|
128834
128930
|
}
|
|
@@ -129976,7 +130072,7 @@ registerCodeFix({
|
|
|
129976
130072
|
});
|
|
129977
130073
|
function createObjectTypeFromLabeledExpression(checker, label, expression) {
|
|
129978
130074
|
const member = checker.createSymbol(4 /* Property */, label.escapedText);
|
|
129979
|
-
member.type = checker.getTypeAtLocation(expression);
|
|
130075
|
+
member.links.type = checker.getTypeAtLocation(expression);
|
|
129980
130076
|
const members = createSymbolTable([member]);
|
|
129981
130077
|
return checker.createAnonymousType(void 0, members, [], [], []);
|
|
129982
130078
|
}
|
|
@@ -132590,7 +132686,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
|
|
|
132590
132686
|
const members = mapEntries(props, (name, types) => {
|
|
132591
132687
|
const isOptional = types.length < anons.length ? 16777216 /* Optional */ : 0;
|
|
132592
132688
|
const s = checker.createSymbol(4 /* Property */ | isOptional, name);
|
|
132593
|
-
s.type = checker.getUnionType(types);
|
|
132689
|
+
s.links.type = checker.getUnionType(types);
|
|
132594
132690
|
return [name, s];
|
|
132595
132691
|
});
|
|
132596
132692
|
const indexInfos = [];
|
|
@@ -132644,7 +132740,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
|
|
|
132644
132740
|
if (usage.properties) {
|
|
132645
132741
|
usage.properties.forEach((u, name) => {
|
|
132646
132742
|
const symbol = checker.createSymbol(4 /* Property */, name);
|
|
132647
|
-
symbol.type = combineFromUsage(u);
|
|
132743
|
+
symbol.links.type = combineFromUsage(u);
|
|
132648
132744
|
members.set(name, symbol);
|
|
132649
132745
|
});
|
|
132650
132746
|
}
|
|
@@ -132720,6 +132816,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
|
|
|
132720
132816
|
return [];
|
|
132721
132817
|
}
|
|
132722
132818
|
function inferFromSignatures(genericSig, usageSig, typeParameter) {
|
|
132819
|
+
var _a2;
|
|
132723
132820
|
const types = [];
|
|
132724
132821
|
for (let i = 0; i < genericSig.parameters.length; i++) {
|
|
132725
132822
|
const genericParam = genericSig.parameters[i];
|
|
@@ -132733,7 +132830,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
|
|
|
132733
132830
|
if (elementType) {
|
|
132734
132831
|
genericParamType = elementType;
|
|
132735
132832
|
}
|
|
132736
|
-
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());
|
|
132737
132834
|
types.push(...inferTypeParameters(genericParamType, targetType, typeParameter));
|
|
132738
132835
|
}
|
|
132739
132836
|
const genericReturn = checker.getReturnTypeOfSignature(genericSig);
|
|
@@ -132749,7 +132846,7 @@ function inferTypeFromReferences(program, references, cancellationToken) {
|
|
|
132749
132846
|
const length2 = Math.max(...calls.map((c) => c.argumentTypes.length));
|
|
132750
132847
|
for (let i = 0; i < length2; i++) {
|
|
132751
132848
|
const symbol = checker.createSymbol(1 /* FunctionScopedVariable */, escapeLeadingUnderscores(`arg${i}`));
|
|
132752
|
-
symbol.type = combineTypes(calls.map((call) => call.argumentTypes[i] || checker.getUndefinedType()));
|
|
132849
|
+
symbol.links.type = combineTypes(calls.map((call) => call.argumentTypes[i] || checker.getUndefinedType()));
|
|
132753
132850
|
if (calls.some((call) => call.argumentTypes[i] === void 0)) {
|
|
132754
132851
|
symbol.flags |= 16777216 /* Optional */;
|
|
132755
132852
|
}
|
|
@@ -133681,11 +133778,11 @@ function getActionsForInvalidImportLocation(context) {
|
|
|
133681
133778
|
}
|
|
133682
133779
|
function getImportCodeFixesForExpression(context, expr) {
|
|
133683
133780
|
const type = context.program.getTypeChecker().getTypeAtLocation(expr);
|
|
133684
|
-
if (!(type.symbol && type.symbol.originatingImport)) {
|
|
133781
|
+
if (!(type.symbol && isTransientSymbol(type.symbol) && type.symbol.links.originatingImport)) {
|
|
133685
133782
|
return [];
|
|
133686
133783
|
}
|
|
133687
133784
|
const fixes = [];
|
|
133688
|
-
const relatedImport = type.symbol.originatingImport;
|
|
133785
|
+
const relatedImport = type.symbol.links.originatingImport;
|
|
133689
133786
|
if (!isImportCall(relatedImport)) {
|
|
133690
133787
|
addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport));
|
|
133691
133788
|
}
|
|
@@ -147405,7 +147502,10 @@ function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration
|
|
|
147405
147502
|
}
|
|
147406
147503
|
});
|
|
147407
147504
|
const lists = checker.getExpandedParameters(candidateSignature);
|
|
147408
|
-
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
|
+
};
|
|
147409
147509
|
return lists.map((parameterList) => ({
|
|
147410
147510
|
isVariadic: isVariadic(parameterList),
|
|
147411
147511
|
parameters: parameterList.map((p) => createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer)),
|
|
@@ -147419,7 +147519,7 @@ function createSignatureHelpParameterForParameter(parameter, checker, enclosingD
|
|
|
147419
147519
|
printer.writeNode(4 /* Unspecified */, param, sourceFile, writer);
|
|
147420
147520
|
});
|
|
147421
147521
|
const isOptional = checker.isOptionalParameter(parameter.valueDeclaration);
|
|
147422
|
-
const isRest = !!(parameter.checkFlags & 32768 /* RestParameter */);
|
|
147522
|
+
const isRest = isTransientSymbol(parameter) && !!(parameter.links.checkFlags & 32768 /* RestParameter */);
|
|
147423
147523
|
return { name: parameter.name, documentation: parameter.getDocumentationComment(checker), displayParts, isOptional, isRest };
|
|
147424
147524
|
}
|
|
147425
147525
|
function createSignatureHelpParameterForTypeParameter(typeParameter, checker, enclosingDeclaration, sourceFile, printer) {
|
|
@@ -147702,7 +147802,7 @@ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeCheck
|
|
|
147702
147802
|
if (flags & 131072 /* Signature */)
|
|
147703
147803
|
return "index" /* indexSignatureElement */;
|
|
147704
147804
|
if (flags & 4 /* Property */) {
|
|
147705
|
-
if (flags & 33554432 /* Transient */ && symbol.checkFlags & 6 /* Synthetic */) {
|
|
147805
|
+
if (flags & 33554432 /* Transient */ && symbol.links.checkFlags & 6 /* Synthetic */) {
|
|
147706
147806
|
const unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), (rootSymbol) => {
|
|
147707
147807
|
const rootSymbolFlags = rootSymbol.getFlags();
|
|
147708
147808
|
if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) {
|
|
@@ -148082,8 +148182,8 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
|
|
148082
148182
|
} else {
|
|
148083
148183
|
addRange(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration));
|
|
148084
148184
|
}
|
|
148085
|
-
if (symbol.target && symbol.target.tupleLabelDeclaration) {
|
|
148086
|
-
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;
|
|
148087
148187
|
Debug.assertNode(labelDecl.name, isIdentifier);
|
|
148088
148188
|
displayParts.push(spacePart());
|
|
148089
148189
|
displayParts.push(punctuationPart(20 /* OpenParenToken */));
|
|
@@ -160501,7 +160601,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
160501
160601
|
return void 0;
|
|
160502
160602
|
const entrypoints = getEntrypointsFromPackageJsonInfo(
|
|
160503
160603
|
packageJson,
|
|
160504
|
-
{ moduleResolution: 2 /*
|
|
160604
|
+
{ moduleResolution: 2 /* Node10 */ },
|
|
160505
160605
|
project,
|
|
160506
160606
|
project.getModuleResolutionCache()
|
|
160507
160607
|
);
|
|
@@ -163380,6 +163480,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
163380
163480
|
ContextFlags,
|
|
163381
163481
|
CoreServicesShimHostAdapter,
|
|
163382
163482
|
Debug,
|
|
163483
|
+
DeprecationVersion,
|
|
163383
163484
|
DiagnosticCategory,
|
|
163384
163485
|
Diagnostics,
|
|
163385
163486
|
DocumentHighlights,
|