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/typescript.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts = (() => {
|
|
|
42
42
|
"src/compiler/corePublic.ts"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-dev.
|
|
45
|
+
version = `${versionMajorMinor}.0-dev.20221216`;
|
|
46
46
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
47
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
48
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3573,7 +3573,7 @@ ${lanes.join("\n")}
|
|
|
3573
3573
|
const name = DiagnosticCategory[d.category];
|
|
3574
3574
|
return lowerCase ? name.toLowerCase() : name;
|
|
3575
3575
|
}
|
|
3576
|
-
var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas;
|
|
3576
|
+
var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas, DeprecationVersion;
|
|
3577
3577
|
var init_types = __esm({
|
|
3578
3578
|
"src/compiler/types.ts"() {
|
|
3579
3579
|
"use strict";
|
|
@@ -4060,18 +4060,18 @@ ${lanes.join("\n")}
|
|
|
4060
4060
|
RelationComparisonResult3[RelationComparisonResult3["ReportsMask"] = 24] = "ReportsMask";
|
|
4061
4061
|
return RelationComparisonResult3;
|
|
4062
4062
|
})(RelationComparisonResult || {});
|
|
4063
|
-
GeneratedIdentifierFlags = /* @__PURE__ */ ((
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
return
|
|
4063
|
+
GeneratedIdentifierFlags = /* @__PURE__ */ ((GeneratedIdentifierFlags2) => {
|
|
4064
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["None"] = 0] = "None";
|
|
4065
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Auto"] = 1] = "Auto";
|
|
4066
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Loop"] = 2] = "Loop";
|
|
4067
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Unique"] = 3] = "Unique";
|
|
4068
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Node"] = 4] = "Node";
|
|
4069
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["KindMask"] = 7] = "KindMask";
|
|
4070
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes";
|
|
4071
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Optimistic"] = 16] = "Optimistic";
|
|
4072
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["FileLevel"] = 32] = "FileLevel";
|
|
4073
|
+
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution";
|
|
4074
|
+
return GeneratedIdentifierFlags2;
|
|
4075
4075
|
})(GeneratedIdentifierFlags || {});
|
|
4076
4076
|
TokenFlags = /* @__PURE__ */ ((TokenFlags2) => {
|
|
4077
4077
|
TokenFlags2[TokenFlags2["None"] = 0] = "None";
|
|
@@ -4673,7 +4673,7 @@ ${lanes.join("\n")}
|
|
|
4673
4673
|
})(DiagnosticCategory || {});
|
|
4674
4674
|
ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => {
|
|
4675
4675
|
ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic";
|
|
4676
|
-
ModuleResolutionKind2[ModuleResolutionKind2["
|
|
4676
|
+
ModuleResolutionKind2[ModuleResolutionKind2["Node10"] = 2] = "Node10";
|
|
4677
4677
|
ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16";
|
|
4678
4678
|
ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext";
|
|
4679
4679
|
ModuleResolutionKind2[ModuleResolutionKind2["Bundler"] = 100] = "Bundler";
|
|
@@ -5229,6 +5229,12 @@ ${lanes.join("\n")}
|
|
|
5229
5229
|
kind: 4 /* MultiLine */
|
|
5230
5230
|
}
|
|
5231
5231
|
};
|
|
5232
|
+
DeprecationVersion = /* @__PURE__ */ ((DeprecationVersion2) => {
|
|
5233
|
+
DeprecationVersion2["v5_0"] = "5.0";
|
|
5234
|
+
DeprecationVersion2["v5_5"] = "5.5";
|
|
5235
|
+
DeprecationVersion2["v6_0"] = "6.0";
|
|
5236
|
+
return DeprecationVersion2;
|
|
5237
|
+
})(DeprecationVersion || {});
|
|
5232
5238
|
}
|
|
5233
5239
|
});
|
|
5234
5240
|
|
|
@@ -7814,7 +7820,7 @@ ${lanes.join("\n")}
|
|
|
7814
7820
|
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."),
|
|
7815
7821
|
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."),
|
|
7816
7822
|
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."),
|
|
7817
|
-
|
|
7823
|
+
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?"),
|
|
7818
7824
|
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."),
|
|
7819
7825
|
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'?"),
|
|
7820
7826
|
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."),
|
|
@@ -7996,7 +8002,7 @@ ${lanes.join("\n")}
|
|
|
7996
8002
|
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."),
|
|
7997
8003
|
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."),
|
|
7998
8004
|
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}'."),
|
|
7999
|
-
|
|
8005
|
+
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'."),
|
|
8000
8006
|
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'."),
|
|
8001
8007
|
Unknown_build_option_0: diag(5072, 1 /* Error */, "Unknown_build_option_0_5072", "Unknown build option '{0}'."),
|
|
8002
8008
|
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}."),
|
|
@@ -8027,6 +8033,9 @@ ${lanes.join("\n")}
|
|
|
8027
8033
|
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'."),
|
|
8028
8034
|
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.`),
|
|
8029
8035
|
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."),
|
|
8036
|
+
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.`),
|
|
8037
|
+
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."),
|
|
8038
|
+
Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."),
|
|
8030
8039
|
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."),
|
|
8031
8040
|
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."),
|
|
8032
8041
|
Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
|
|
@@ -11631,10 +11640,10 @@ ${lanes.join("\n")}
|
|
|
11631
11640
|
return node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
|
|
11632
11641
|
}
|
|
11633
11642
|
function isGeneratedIdentifier(node) {
|
|
11634
|
-
return isIdentifier(node) &&
|
|
11643
|
+
return isIdentifier(node) && node.autoGenerate !== void 0;
|
|
11635
11644
|
}
|
|
11636
11645
|
function isGeneratedPrivateIdentifier(node) {
|
|
11637
|
-
return isPrivateIdentifier(node) &&
|
|
11646
|
+
return isPrivateIdentifier(node) && node.autoGenerate !== void 0;
|
|
11638
11647
|
}
|
|
11639
11648
|
function isPrivateIdentifierClassElementDeclaration(node) {
|
|
11640
11649
|
return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name);
|
|
@@ -13005,7 +13014,7 @@ ${lanes.join("\n")}
|
|
|
13005
13014
|
switch (name.kind) {
|
|
13006
13015
|
case 79 /* Identifier */:
|
|
13007
13016
|
case 80 /* PrivateIdentifier */:
|
|
13008
|
-
return name.
|
|
13017
|
+
return name.autoGenerate ? void 0 : name.escapedText;
|
|
13009
13018
|
case 10 /* StringLiteral */:
|
|
13010
13019
|
case 8 /* NumericLiteral */:
|
|
13011
13020
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
@@ -16204,7 +16213,7 @@ ${lanes.join("\n")}
|
|
|
16204
16213
|
watcher.close();
|
|
16205
16214
|
}
|
|
16206
16215
|
function getCheckFlags(symbol) {
|
|
16207
|
-
return symbol.flags & 33554432 /* Transient */ ? symbol.checkFlags : 0;
|
|
16216
|
+
return symbol.flags & 33554432 /* Transient */ ? symbol.links.checkFlags : 0;
|
|
16208
16217
|
}
|
|
16209
16218
|
function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
16210
16219
|
if (s.valueDeclaration) {
|
|
@@ -16213,7 +16222,7 @@ ${lanes.join("\n")}
|
|
|
16213
16222
|
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~28 /* AccessibilityModifier */;
|
|
16214
16223
|
}
|
|
16215
16224
|
if (getCheckFlags(s) & 6 /* Synthetic */) {
|
|
16216
|
-
const checkFlags = s.checkFlags;
|
|
16225
|
+
const checkFlags = s.links.checkFlags;
|
|
16217
16226
|
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 8 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 4 /* Public */ : 16 /* Protected */;
|
|
16218
16227
|
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 32 /* Static */ : 0;
|
|
16219
16228
|
return accessModifier | staticModifier;
|
|
@@ -16471,9 +16480,16 @@ ${lanes.join("\n")}
|
|
|
16471
16480
|
this.escapedName = name;
|
|
16472
16481
|
this.declarations = void 0;
|
|
16473
16482
|
this.valueDeclaration = void 0;
|
|
16474
|
-
this.id =
|
|
16475
|
-
this.mergeId =
|
|
16483
|
+
this.id = 0;
|
|
16484
|
+
this.mergeId = 0;
|
|
16476
16485
|
this.parent = void 0;
|
|
16486
|
+
this.members = void 0;
|
|
16487
|
+
this.exports = void 0;
|
|
16488
|
+
this.exportSymbol = void 0;
|
|
16489
|
+
this.constEnumOnlyModule = void 0;
|
|
16490
|
+
this.isReferenced = void 0;
|
|
16491
|
+
this.isAssigned = void 0;
|
|
16492
|
+
this.links = void 0;
|
|
16477
16493
|
}
|
|
16478
16494
|
function Type3(checker, flags) {
|
|
16479
16495
|
this.flags = flags;
|
|
@@ -16775,7 +16791,7 @@ ${lanes.join("\n")}
|
|
|
16775
16791
|
if (moduleResolution === void 0) {
|
|
16776
16792
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
16777
16793
|
case 1 /* CommonJS */:
|
|
16778
|
-
moduleResolution = 2 /*
|
|
16794
|
+
moduleResolution = 2 /* Node10 */;
|
|
16779
16795
|
break;
|
|
16780
16796
|
case 100 /* Node16 */:
|
|
16781
16797
|
moduleResolution = 3 /* Node16 */;
|
|
@@ -19284,15 +19300,23 @@ ${lanes.join("\n")}
|
|
|
19284
19300
|
const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
|
|
19285
19301
|
node.originalKeywordKind = originalKeywordKind;
|
|
19286
19302
|
node.escapedText = escapedText;
|
|
19287
|
-
node.
|
|
19303
|
+
node.autoGenerate = void 0;
|
|
19304
|
+
node.typeArguments = void 0;
|
|
19305
|
+
node.hasExtendedUnicodeEscape = void 0;
|
|
19306
|
+
node.jsDoc = void 0;
|
|
19307
|
+
node.jsDocCache = void 0;
|
|
19308
|
+
node.flowNode = void 0;
|
|
19309
|
+
node.symbol = void 0;
|
|
19288
19310
|
return node;
|
|
19289
19311
|
}
|
|
19290
19312
|
function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
19291
19313
|
const node = createBaseIdentifier(escapeLeadingUnderscores(text), void 0);
|
|
19292
|
-
node.
|
|
19293
|
-
|
|
19294
|
-
|
|
19295
|
-
|
|
19314
|
+
node.autoGenerate = {
|
|
19315
|
+
flags: autoGenerateFlags,
|
|
19316
|
+
id: nextAutoGenerateId,
|
|
19317
|
+
prefix,
|
|
19318
|
+
suffix
|
|
19319
|
+
};
|
|
19296
19320
|
nextAutoGenerateId++;
|
|
19297
19321
|
return node;
|
|
19298
19322
|
}
|
|
@@ -19306,10 +19330,6 @@ ${lanes.join("\n")}
|
|
|
19306
19330
|
const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind);
|
|
19307
19331
|
node.typeArguments = asNodeArray(typeArguments);
|
|
19308
19332
|
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
19309
|
-
node.jsDoc = void 0;
|
|
19310
|
-
node.jsDocCache = void 0;
|
|
19311
|
-
node.flowNode = void 0;
|
|
19312
|
-
node.symbol = void 0;
|
|
19313
19333
|
if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
|
|
19314
19334
|
node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
|
|
19315
19335
|
}
|
|
@@ -19354,7 +19374,7 @@ ${lanes.join("\n")}
|
|
|
19354
19374
|
function createBasePrivateIdentifier(escapedText) {
|
|
19355
19375
|
const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
|
|
19356
19376
|
node.escapedText = escapedText;
|
|
19357
|
-
node.
|
|
19377
|
+
node.autoGenerate = void 0;
|
|
19358
19378
|
node.transformFlags |= 16777216 /* ContainsClassFields */;
|
|
19359
19379
|
return node;
|
|
19360
19380
|
}
|
|
@@ -19365,10 +19385,12 @@ ${lanes.join("\n")}
|
|
|
19365
19385
|
}
|
|
19366
19386
|
function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
19367
19387
|
const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
|
|
19368
|
-
node.
|
|
19369
|
-
|
|
19370
|
-
|
|
19371
|
-
|
|
19388
|
+
node.autoGenerate = {
|
|
19389
|
+
flags: autoGenerateFlags,
|
|
19390
|
+
id: nextAutoGenerateId,
|
|
19391
|
+
prefix,
|
|
19392
|
+
suffix
|
|
19393
|
+
};
|
|
19372
19394
|
nextAutoGenerateId++;
|
|
19373
19395
|
return node;
|
|
19374
19396
|
}
|
|
@@ -22161,10 +22183,7 @@ ${lanes.join("\n")}
|
|
|
22161
22183
|
function cloneGeneratedIdentifier(node) {
|
|
22162
22184
|
const clone2 = createBaseIdentifier(node.escapedText, void 0);
|
|
22163
22185
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
22164
|
-
clone2.
|
|
22165
|
-
clone2.autoGenerateId = node.autoGenerateId;
|
|
22166
|
-
clone2.autoGeneratePrefix = node.autoGeneratePrefix;
|
|
22167
|
-
clone2.autoGenerateSuffix = node.autoGenerateSuffix;
|
|
22186
|
+
clone2.autoGenerate = { ...node.autoGenerate };
|
|
22168
22187
|
clone2.transformFlags = node.transformFlags;
|
|
22169
22188
|
setOriginalNode(clone2, node);
|
|
22170
22189
|
return clone2;
|
|
@@ -22185,10 +22204,7 @@ ${lanes.join("\n")}
|
|
|
22185
22204
|
function cloneGeneratedPrivateIdentifier(node) {
|
|
22186
22205
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
22187
22206
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
22188
|
-
clone2.
|
|
22189
|
-
clone2.autoGenerateId = node.autoGenerateId;
|
|
22190
|
-
clone2.autoGeneratePrefix = node.autoGeneratePrefix;
|
|
22191
|
-
clone2.autoGenerateSuffix = node.autoGenerateSuffix;
|
|
22207
|
+
clone2.autoGenerate = { ...node.autoGenerate };
|
|
22192
22208
|
clone2.transformFlags = node.transformFlags;
|
|
22193
22209
|
setOriginalNode(clone2, node);
|
|
22194
22210
|
return clone2;
|
|
@@ -25467,13 +25483,13 @@ ${lanes.join("\n")}
|
|
|
25467
25483
|
return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes);
|
|
25468
25484
|
}
|
|
25469
25485
|
function getNodeForGeneratedName(name) {
|
|
25470
|
-
if (name.
|
|
25471
|
-
const autoGenerateId = name.
|
|
25486
|
+
if (name.autoGenerate.flags & 4 /* Node */) {
|
|
25487
|
+
const autoGenerateId = name.autoGenerate.id;
|
|
25472
25488
|
let node = name;
|
|
25473
25489
|
let original = node.original;
|
|
25474
25490
|
while (original) {
|
|
25475
25491
|
node = original;
|
|
25476
|
-
if (isMemberName(node) && !!(node.
|
|
25492
|
+
if (isMemberName(node) && (node.autoGenerate === void 0 || !!(node.autoGenerate.flags & 4 /* Node */) && node.autoGenerate.id !== autoGenerateId)) {
|
|
25477
25493
|
break;
|
|
25478
25494
|
}
|
|
25479
25495
|
original = node.original;
|
|
@@ -32662,8 +32678,9 @@ ${lanes.join("\n")}
|
|
|
32662
32678
|
return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic);
|
|
32663
32679
|
}
|
|
32664
32680
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
32665
|
-
const namesOfType = arrayFrom(opt.type.keys())
|
|
32666
|
-
|
|
32681
|
+
const namesOfType = arrayFrom(opt.type.keys());
|
|
32682
|
+
const stringNames = (opt.deprecatedKeys ? namesOfType.filter((k) => !opt.deprecatedKeys.has(k)) : namesOfType).map((key) => `'${key}'`).join(", ");
|
|
32683
|
+
return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
|
|
32667
32684
|
}
|
|
32668
32685
|
function parseCustomTypeOption(opt, value, errors) {
|
|
32669
32686
|
return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors);
|
|
@@ -33851,7 +33868,7 @@ ${lanes.join("\n")}
|
|
|
33851
33868
|
}
|
|
33852
33869
|
return extendedConfigPath;
|
|
33853
33870
|
}
|
|
33854
|
-
const resolved = nodeModuleNameResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), { moduleResolution: 2 /*
|
|
33871
|
+
const resolved = nodeModuleNameResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), { moduleResolution: 2 /* Node10 */ }, host, void 0, void 0, true);
|
|
33855
33872
|
if (resolved.resolvedModule) {
|
|
33856
33873
|
return resolved.resolvedModule.resolvedFileName;
|
|
33857
33874
|
}
|
|
@@ -35060,12 +35077,14 @@ ${lanes.join("\n")}
|
|
|
35060
35077
|
{
|
|
35061
35078
|
name: "moduleResolution",
|
|
35062
35079
|
type: new Map(getEntries({
|
|
35063
|
-
|
|
35080
|
+
node10: 2 /* Node10 */,
|
|
35081
|
+
node: 2 /* Node10 */,
|
|
35064
35082
|
classic: 1 /* Classic */,
|
|
35065
35083
|
node16: 3 /* Node16 */,
|
|
35066
35084
|
nodenext: 99 /* NodeNext */,
|
|
35067
35085
|
bundler: 100 /* Bundler */
|
|
35068
35086
|
})),
|
|
35087
|
+
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
35069
35088
|
affectsModuleResolution: true,
|
|
35070
35089
|
paramType: Diagnostics.STRATEGY,
|
|
35071
35090
|
category: Diagnostics.Modules,
|
|
@@ -35585,6 +35604,11 @@ ${lanes.join("\n")}
|
|
|
35585
35604
|
description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
35586
35605
|
category: Diagnostics.Language_and_Environment,
|
|
35587
35606
|
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
|
|
35607
|
+
},
|
|
35608
|
+
{
|
|
35609
|
+
name: "ignoreDeprecations",
|
|
35610
|
+
type: "string",
|
|
35611
|
+
defaultValueDescription: void 0
|
|
35588
35612
|
}
|
|
35589
35613
|
];
|
|
35590
35614
|
optionDeclarations = [
|
|
@@ -36498,7 +36522,7 @@ ${lanes.join("\n")}
|
|
|
36498
36522
|
if (moduleResolution === void 0) {
|
|
36499
36523
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
36500
36524
|
case 1 /* CommonJS */:
|
|
36501
|
-
moduleResolution = 2 /*
|
|
36525
|
+
moduleResolution = 2 /* Node10 */;
|
|
36502
36526
|
break;
|
|
36503
36527
|
case 100 /* Node16 */:
|
|
36504
36528
|
moduleResolution = 3 /* Node16 */;
|
|
@@ -36526,7 +36550,7 @@ ${lanes.join("\n")}
|
|
|
36526
36550
|
case 99 /* NodeNext */:
|
|
36527
36551
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
36528
36552
|
break;
|
|
36529
|
-
case 2 /*
|
|
36553
|
+
case 2 /* Node10 */:
|
|
36530
36554
|
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
36531
36555
|
break;
|
|
36532
36556
|
case 1 /* Classic */:
|
|
@@ -36702,7 +36726,7 @@ ${lanes.join("\n")}
|
|
|
36702
36726
|
0 /* None */,
|
|
36703
36727
|
moduleName,
|
|
36704
36728
|
initialDir,
|
|
36705
|
-
{ moduleResolution: 2 /*
|
|
36729
|
+
{ moduleResolution: 2 /* Node10 */, allowJs: true },
|
|
36706
36730
|
host,
|
|
36707
36731
|
void 0,
|
|
36708
36732
|
2 /* JavaScript */,
|
|
@@ -36755,7 +36779,7 @@ ${lanes.join("\n")}
|
|
|
36755
36779
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
36756
36780
|
}
|
|
36757
36781
|
let result;
|
|
36758
|
-
if (getEmitModuleResolutionKind(compilerOptions) === 2 /*
|
|
36782
|
+
if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) {
|
|
36759
36783
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
36760
36784
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
36761
36785
|
result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
|
|
@@ -41385,8 +41409,6 @@ ${lanes.join("\n")}
|
|
|
41385
41409
|
});
|
|
41386
41410
|
|
|
41387
41411
|
// src/compiler/checker.ts
|
|
41388
|
-
function SymbolLinks() {
|
|
41389
|
-
}
|
|
41390
41412
|
function NodeLinks() {
|
|
41391
41413
|
this.flags = 0 /* None */;
|
|
41392
41414
|
}
|
|
@@ -42241,7 +42263,8 @@ ${lanes.join("\n")}
|
|
|
42241
42263
|
function createSymbol(flags, name, checkFlags) {
|
|
42242
42264
|
symbolCount++;
|
|
42243
42265
|
const symbol = new Symbol46(flags | 33554432 /* Transient */, name);
|
|
42244
|
-
symbol.
|
|
42266
|
+
symbol.links = new SymbolLinks();
|
|
42267
|
+
symbol.links.checkFlags = checkFlags || 0 /* None */;
|
|
42245
42268
|
return symbol;
|
|
42246
42269
|
}
|
|
42247
42270
|
function getExcludedSymbolFlags(flags) {
|
|
@@ -42466,10 +42489,11 @@ ${lanes.join("\n")}
|
|
|
42466
42489
|
}
|
|
42467
42490
|
}
|
|
42468
42491
|
function getSymbolLinks(symbol) {
|
|
42492
|
+
var _a2;
|
|
42469
42493
|
if (symbol.flags & 33554432 /* Transient */)
|
|
42470
|
-
return symbol;
|
|
42494
|
+
return symbol.links;
|
|
42471
42495
|
const id = getSymbolId(symbol);
|
|
42472
|
-
return symbolLinks[id]
|
|
42496
|
+
return (_a2 = symbolLinks[id]) != null ? _a2 : symbolLinks[id] = new SymbolLinks();
|
|
42473
42497
|
}
|
|
42474
42498
|
function getNodeLinks(node) {
|
|
42475
42499
|
const nodeId = getNodeId(node);
|
|
@@ -44003,7 +44027,7 @@ ${lanes.join("\n")}
|
|
|
44003
44027
|
}
|
|
44004
44028
|
function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) {
|
|
44005
44029
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
44006
|
-
const errorMessage = isClassic ? Diagnostics.
|
|
44030
|
+
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;
|
|
44007
44031
|
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage);
|
|
44008
44032
|
}
|
|
44009
44033
|
function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation = false) {
|
|
@@ -44269,8 +44293,8 @@ ${lanes.join("\n")}
|
|
|
44269
44293
|
const result = createSymbol(symbol.flags, symbol.escapedName);
|
|
44270
44294
|
result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
|
|
44271
44295
|
result.parent = symbol.parent;
|
|
44272
|
-
result.target = symbol;
|
|
44273
|
-
result.originatingImport = referenceParent;
|
|
44296
|
+
result.links.target = symbol;
|
|
44297
|
+
result.links.originatingImport = referenceParent;
|
|
44274
44298
|
if (symbol.valueDeclaration)
|
|
44275
44299
|
result.valueDeclaration = symbol.valueDeclaration;
|
|
44276
44300
|
if (symbol.constEnumOnlyModule)
|
|
@@ -44280,7 +44304,7 @@ ${lanes.join("\n")}
|
|
|
44280
44304
|
if (symbol.exports)
|
|
44281
44305
|
result.exports = new Map(symbol.exports);
|
|
44282
44306
|
const resolvedModuleType = resolveStructuredTypeMembers(moduleType);
|
|
44283
|
-
result.type = createAnonymousType(result, resolvedModuleType.members, emptyArray, emptyArray, resolvedModuleType.indexInfos);
|
|
44307
|
+
result.links.type = createAnonymousType(result, resolvedModuleType.members, emptyArray, emptyArray, resolvedModuleType.indexInfos);
|
|
44284
44308
|
return result;
|
|
44285
44309
|
}
|
|
44286
44310
|
function hasExportAssignmentSymbol(moduleSymbol) {
|
|
@@ -45735,7 +45759,7 @@ ${lanes.join("\n")}
|
|
|
45735
45759
|
}
|
|
45736
45760
|
function shouldUsePlaceholderForProperty(propertySymbol, context) {
|
|
45737
45761
|
var _a2;
|
|
45738
|
-
return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((_a2 = context.reverseMappedStack) == null ? void 0 : _a2[0]) && !(getObjectFlags(last(context.reverseMappedStack).propertyType) & 16 /* Anonymous */));
|
|
45762
|
+
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 */));
|
|
45739
45763
|
}
|
|
45740
45764
|
function addPropertyToElementList(propertySymbol, context, typeElements) {
|
|
45741
45765
|
var _a2;
|
|
@@ -46111,7 +46135,7 @@ ${lanes.join("\n")}
|
|
|
46111
46135
|
const params = getTypeParametersOfClassOrInterface(
|
|
46112
46136
|
parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol
|
|
46113
46137
|
);
|
|
46114
|
-
typeParameterNodes = mapToTypeNodes(map(params, (t) => getMappedType(t, nextSymbol.mapper)), context);
|
|
46138
|
+
typeParameterNodes = mapToTypeNodes(map(params, (t) => getMappedType(t, nextSymbol.links.mapper)), context);
|
|
46115
46139
|
} else {
|
|
46116
46140
|
typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context);
|
|
46117
46141
|
}
|
|
@@ -48588,7 +48612,7 @@ ${lanes.join("\n")}
|
|
|
48588
48612
|
);
|
|
48589
48613
|
}
|
|
48590
48614
|
const union = createSymbol(s.flags | exportedMember.flags, name);
|
|
48591
|
-
union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
|
|
48615
|
+
union.links.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
|
|
48592
48616
|
union.valueDeclaration = exportedMember.valueDeclaration;
|
|
48593
48617
|
union.declarations = concatenate(exportedMember.declarations, s.declarations);
|
|
48594
48618
|
members.set(name, union);
|
|
@@ -48675,8 +48699,8 @@ ${lanes.join("\n")}
|
|
|
48675
48699
|
const text = getPropertyNameFromType(exprType);
|
|
48676
48700
|
const flags = 4 /* Property */ | (e.initializer ? 16777216 /* Optional */ : 0);
|
|
48677
48701
|
const symbol = createSymbol(flags, text);
|
|
48678
|
-
symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors2);
|
|
48679
|
-
symbol.bindingElement = e;
|
|
48702
|
+
symbol.links.type = getTypeFromBindingElement(e, includePatternInType, reportErrors2);
|
|
48703
|
+
symbol.links.bindingElement = e;
|
|
48680
48704
|
members.set(symbol.escapedName, symbol);
|
|
48681
48705
|
});
|
|
48682
48706
|
const result = createAnonymousType(void 0, members, emptyArray, emptyArray, stringIndexInfo ? [stringIndexInfo] : emptyArray);
|
|
@@ -48784,7 +48808,7 @@ ${lanes.join("\n")}
|
|
|
48784
48808
|
const result = createSymbol(fileSymbol.flags, "exports");
|
|
48785
48809
|
result.declarations = fileSymbol.declarations ? fileSymbol.declarations.slice() : [];
|
|
48786
48810
|
result.parent = symbol;
|
|
48787
|
-
result.target = fileSymbol;
|
|
48811
|
+
result.links.target = fileSymbol;
|
|
48788
48812
|
if (fileSymbol.valueDeclaration)
|
|
48789
48813
|
result.valueDeclaration = fileSymbol.valueDeclaration;
|
|
48790
48814
|
if (fileSymbol.members)
|
|
@@ -48950,7 +48974,8 @@ ${lanes.join("\n")}
|
|
|
48950
48974
|
if (expando) {
|
|
48951
48975
|
const merged = mergeJSSymbols(symbol, expando);
|
|
48952
48976
|
if (merged) {
|
|
48953
|
-
symbol =
|
|
48977
|
+
symbol = merged;
|
|
48978
|
+
links = merged.links;
|
|
48954
48979
|
}
|
|
48955
48980
|
}
|
|
48956
48981
|
originalLinks.type = links.type = getTypeOfFuncClassEnumModuleWorker(symbol);
|
|
@@ -49047,7 +49072,7 @@ ${lanes.join("\n")}
|
|
|
49047
49072
|
function getWriteTypeOfSymbol(symbol) {
|
|
49048
49073
|
const checkFlags = getCheckFlags(symbol);
|
|
49049
49074
|
if (symbol.flags & 4 /* Property */) {
|
|
49050
|
-
return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.writeType || symbol.type : getTypeOfSymbol(symbol);
|
|
49075
|
+
return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.links.writeType || symbol.links.type : getTypeOfSymbol(symbol);
|
|
49051
49076
|
}
|
|
49052
49077
|
if (symbol.flags & 98304 /* Accessor */) {
|
|
49053
49078
|
return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
|
|
@@ -49449,7 +49474,8 @@ ${lanes.join("\n")}
|
|
|
49449
49474
|
const kind = symbol.flags & 32 /* Class */ ? 1 /* Class */ : 2 /* Interface */;
|
|
49450
49475
|
const merged = mergeJSSymbols(symbol, symbol.valueDeclaration && getAssignedClassSymbol(symbol.valueDeclaration));
|
|
49451
49476
|
if (merged) {
|
|
49452
|
-
symbol =
|
|
49477
|
+
symbol = merged;
|
|
49478
|
+
links = merged.links;
|
|
49453
49479
|
}
|
|
49454
49480
|
const type = originalLinks.declaredType = links.declaredType = createObjectType(kind, symbol);
|
|
49455
49481
|
const outerTypeParameters = getOuterTypeParametersOfClassOrInterface(symbol);
|
|
@@ -49725,7 +49751,7 @@ ${lanes.join("\n")}
|
|
|
49725
49751
|
error(declName || decl, Diagnostics.Duplicate_property_0, name);
|
|
49726
49752
|
lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */);
|
|
49727
49753
|
}
|
|
49728
|
-
lateSymbol.nameType = type;
|
|
49754
|
+
lateSymbol.links.nameType = type;
|
|
49729
49755
|
addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags);
|
|
49730
49756
|
if (lateSymbol.parent) {
|
|
49731
49757
|
Debug.assert(lateSymbol.parent === parent2, "Existing symbol parent should match new one");
|
|
@@ -49931,7 +49957,7 @@ ${lanes.join("\n")}
|
|
|
49931
49957
|
const flags = restType.target.elementFlags[i];
|
|
49932
49958
|
const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
|
|
49933
49959
|
const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
|
|
49934
|
-
symbol.type = flags & 4 /* Rest */ ? createArrayType(t) : t;
|
|
49960
|
+
symbol.links.type = flags & 4 /* Rest */ ? createArrayType(t) : t;
|
|
49935
49961
|
return symbol;
|
|
49936
49962
|
});
|
|
49937
49963
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
@@ -50091,14 +50117,14 @@ ${lanes.join("\n")}
|
|
|
50091
50117
|
1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0),
|
|
50092
50118
|
paramName || `arg${i}`
|
|
50093
50119
|
);
|
|
50094
|
-
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
50120
|
+
paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
50095
50121
|
params[i] = paramSymbol;
|
|
50096
50122
|
}
|
|
50097
50123
|
if (needsExtraRestElement) {
|
|
50098
50124
|
const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args");
|
|
50099
|
-
restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
50125
|
+
restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
50100
50126
|
if (shorter === right) {
|
|
50101
|
-
restParamSymbol.type = instantiateType(restParamSymbol.type, mapper);
|
|
50127
|
+
restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper);
|
|
50102
50128
|
}
|
|
50103
50129
|
params[longestCount] = restParamSymbol;
|
|
50104
50130
|
}
|
|
@@ -50318,16 +50344,16 @@ ${lanes.join("\n")}
|
|
|
50318
50344
|
const checkFlags = 8192 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0);
|
|
50319
50345
|
const inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags);
|
|
50320
50346
|
inferredProp.declarations = prop.declarations;
|
|
50321
|
-
inferredProp.nameType = getSymbolLinks(prop).nameType;
|
|
50322
|
-
inferredProp.propertyType = getTypeOfSymbol(prop);
|
|
50347
|
+
inferredProp.links.nameType = getSymbolLinks(prop).nameType;
|
|
50348
|
+
inferredProp.links.propertyType = getTypeOfSymbol(prop);
|
|
50323
50349
|
if (type.constraintType.type.flags & 8388608 /* IndexedAccess */ && type.constraintType.type.objectType.flags & 262144 /* TypeParameter */ && type.constraintType.type.indexType.flags & 262144 /* TypeParameter */) {
|
|
50324
50350
|
const newTypeParam = type.constraintType.type.objectType;
|
|
50325
50351
|
const newMappedType = replaceIndexedAccess(type.mappedType, type.constraintType.type, newTypeParam);
|
|
50326
|
-
inferredProp.mappedType = newMappedType;
|
|
50327
|
-
inferredProp.constraintType = getIndexType(newTypeParam);
|
|
50352
|
+
inferredProp.links.mappedType = newMappedType;
|
|
50353
|
+
inferredProp.links.constraintType = getIndexType(newTypeParam);
|
|
50328
50354
|
} else {
|
|
50329
|
-
inferredProp.mappedType = type.mappedType;
|
|
50330
|
-
inferredProp.constraintType = type.constraintType;
|
|
50355
|
+
inferredProp.links.mappedType = type.mappedType;
|
|
50356
|
+
inferredProp.links.constraintType = type.constraintType;
|
|
50331
50357
|
}
|
|
50332
50358
|
members.set(prop.escapedName, inferredProp);
|
|
50333
50359
|
}
|
|
@@ -50403,8 +50429,8 @@ ${lanes.join("\n")}
|
|
|
50403
50429
|
const propName = getPropertyNameFromType(propNameType);
|
|
50404
50430
|
const existingProp = members.get(propName);
|
|
50405
50431
|
if (existingProp) {
|
|
50406
|
-
existingProp.nameType = getUnionType([existingProp.nameType, propNameType]);
|
|
50407
|
-
existingProp.keyType = getUnionType([existingProp.keyType, keyType]);
|
|
50432
|
+
existingProp.links.nameType = getUnionType([existingProp.links.nameType, propNameType]);
|
|
50433
|
+
existingProp.links.keyType = getUnionType([existingProp.links.keyType, keyType]);
|
|
50408
50434
|
} else {
|
|
50409
50435
|
const modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : void 0;
|
|
50410
50436
|
const isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */);
|
|
@@ -50416,11 +50442,11 @@ ${lanes.join("\n")}
|
|
|
50416
50442
|
propName,
|
|
50417
50443
|
lateFlag | 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0)
|
|
50418
50444
|
);
|
|
50419
|
-
prop.mappedType = type;
|
|
50420
|
-
prop.nameType = propNameType;
|
|
50421
|
-
prop.keyType = keyType;
|
|
50445
|
+
prop.links.mappedType = type;
|
|
50446
|
+
prop.links.nameType = propNameType;
|
|
50447
|
+
prop.links.keyType = keyType;
|
|
50422
50448
|
if (modifiersProp) {
|
|
50423
|
-
prop.syntheticOrigin = modifiersProp;
|
|
50449
|
+
prop.links.syntheticOrigin = modifiersProp;
|
|
50424
50450
|
prop.declarations = nameType ? void 0 : modifiersProp.declarations;
|
|
50425
50451
|
}
|
|
50426
50452
|
members.set(propName, prop);
|
|
@@ -50434,23 +50460,23 @@ ${lanes.join("\n")}
|
|
|
50434
50460
|
}
|
|
50435
50461
|
}
|
|
50436
50462
|
function getTypeOfMappedSymbol(symbol) {
|
|
50437
|
-
if (!symbol.type) {
|
|
50438
|
-
const mappedType = symbol.mappedType;
|
|
50463
|
+
if (!symbol.links.type) {
|
|
50464
|
+
const mappedType = symbol.links.mappedType;
|
|
50439
50465
|
if (!pushTypeResolution(symbol, 0 /* Type */)) {
|
|
50440
50466
|
mappedType.containsError = true;
|
|
50441
50467
|
return errorType;
|
|
50442
50468
|
}
|
|
50443
50469
|
const templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType);
|
|
50444
|
-
const mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType);
|
|
50470
|
+
const mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.links.keyType);
|
|
50445
50471
|
const propType = instantiateType(templateType, mapper);
|
|
50446
|
-
let type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType, true) : symbol.checkFlags & 524288 /* StripOptional */ ? removeMissingOrUndefinedType(propType) : propType;
|
|
50472
|
+
let type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType, true) : symbol.links.checkFlags & 524288 /* StripOptional */ ? removeMissingOrUndefinedType(propType) : propType;
|
|
50447
50473
|
if (!popTypeResolution()) {
|
|
50448
50474
|
error(currentNode, Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType));
|
|
50449
50475
|
type = errorType;
|
|
50450
50476
|
}
|
|
50451
|
-
symbol.type = type;
|
|
50477
|
+
symbol.links.type = type;
|
|
50452
50478
|
}
|
|
50453
|
-
return symbol.type;
|
|
50479
|
+
return symbol.links.type;
|
|
50454
50480
|
}
|
|
50455
50481
|
function getTypeParameterFromMappedType(type) {
|
|
50456
50482
|
return type.typeParameter || (type.typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(type.declaration.typeParameter)));
|
|
@@ -50865,7 +50891,7 @@ ${lanes.join("\n")}
|
|
|
50865
50891
|
return getReducedType(getApparentType(getReducedType(type)));
|
|
50866
50892
|
}
|
|
50867
50893
|
function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) {
|
|
50868
|
-
var _a2, _b;
|
|
50894
|
+
var _a2, _b, _c;
|
|
50869
50895
|
let singleProp;
|
|
50870
50896
|
let propSet;
|
|
50871
50897
|
let indexTypes;
|
|
@@ -50933,10 +50959,11 @@ ${lanes.join("\n")}
|
|
|
50933
50959
|
}
|
|
50934
50960
|
if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) {
|
|
50935
50961
|
if (mergedInstantiations) {
|
|
50936
|
-
const
|
|
50937
|
-
clone2
|
|
50938
|
-
clone2.
|
|
50939
|
-
clone2.
|
|
50962
|
+
const links = (_a2 = tryCast(singleProp, isTransientSymbol)) == null ? void 0 : _a2.links;
|
|
50963
|
+
const clone2 = createSymbolWithType(singleProp, links == null ? void 0 : links.type);
|
|
50964
|
+
clone2.parent = (_c = (_b = singleProp.valueDeclaration) == null ? void 0 : _b.symbol) == null ? void 0 : _c.parent;
|
|
50965
|
+
clone2.links.containingType = containingType;
|
|
50966
|
+
clone2.links.mapper = links == null ? void 0 : links.mapper;
|
|
50940
50967
|
return clone2;
|
|
50941
50968
|
} else {
|
|
50942
50969
|
return singleProp;
|
|
@@ -50978,7 +51005,7 @@ ${lanes.join("\n")}
|
|
|
50978
51005
|
}
|
|
50979
51006
|
addRange(propTypes, indexTypes);
|
|
50980
51007
|
const result = createSymbol(4 /* Property */ | (optionalFlag != null ? optionalFlag : 0), name, syntheticFlag | checkFlags);
|
|
50981
|
-
result.containingType = containingType;
|
|
51008
|
+
result.links.containingType = containingType;
|
|
50982
51009
|
if (!hasNonUniformValueDeclaration && firstValueDeclaration) {
|
|
50983
51010
|
result.valueDeclaration = firstValueDeclaration;
|
|
50984
51011
|
if (firstValueDeclaration.symbol.parent) {
|
|
@@ -50986,16 +51013,16 @@ ${lanes.join("\n")}
|
|
|
50986
51013
|
}
|
|
50987
51014
|
}
|
|
50988
51015
|
result.declarations = declarations;
|
|
50989
|
-
result.nameType = nameType;
|
|
51016
|
+
result.links.nameType = nameType;
|
|
50990
51017
|
if (propTypes.length > 2) {
|
|
50991
|
-
result.checkFlags |= 65536 /* DeferredType */;
|
|
50992
|
-
result.deferralParent = containingType;
|
|
50993
|
-
result.deferralConstituents = propTypes;
|
|
50994
|
-
result.deferralWriteConstituents = writeTypes;
|
|
51018
|
+
result.links.checkFlags |= 65536 /* DeferredType */;
|
|
51019
|
+
result.links.deferralParent = containingType;
|
|
51020
|
+
result.links.deferralConstituents = propTypes;
|
|
51021
|
+
result.links.deferralWriteConstituents = writeTypes;
|
|
50995
51022
|
} else {
|
|
50996
|
-
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
51023
|
+
result.links.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
50997
51024
|
if (writeTypes) {
|
|
50998
|
-
result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
51025
|
+
result.links.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
50999
51026
|
}
|
|
51000
51027
|
}
|
|
51001
51028
|
return result;
|
|
@@ -51332,12 +51359,12 @@ ${lanes.join("\n")}
|
|
|
51332
51359
|
const lastParamVariadicType = firstDefined(lastParamTags, (p) => p.typeExpression && isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : void 0);
|
|
51333
51360
|
const syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 32768 /* RestParameter */);
|
|
51334
51361
|
if (lastParamVariadicType) {
|
|
51335
|
-
syntheticArgsSymbol.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
51362
|
+
syntheticArgsSymbol.links.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
51336
51363
|
} else {
|
|
51337
|
-
syntheticArgsSymbol.checkFlags |= 65536 /* DeferredType */;
|
|
51338
|
-
syntheticArgsSymbol.deferralParent = neverType;
|
|
51339
|
-
syntheticArgsSymbol.deferralConstituents = [anyArrayType];
|
|
51340
|
-
syntheticArgsSymbol.deferralWriteConstituents = [anyArrayType];
|
|
51364
|
+
syntheticArgsSymbol.links.checkFlags |= 65536 /* DeferredType */;
|
|
51365
|
+
syntheticArgsSymbol.links.deferralParent = neverType;
|
|
51366
|
+
syntheticArgsSymbol.links.deferralConstituents = [anyArrayType];
|
|
51367
|
+
syntheticArgsSymbol.links.deferralWriteConstituents = [anyArrayType];
|
|
51341
51368
|
}
|
|
51342
51369
|
if (lastParamVariadicType) {
|
|
51343
51370
|
parameters.pop();
|
|
@@ -51951,7 +51978,7 @@ ${lanes.join("\n")}
|
|
|
51951
51978
|
if (!result) {
|
|
51952
51979
|
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
|
|
51953
51980
|
result.parent = parentSymbol;
|
|
51954
|
-
result.declaredType = unresolvedType;
|
|
51981
|
+
result.links.declaredType = unresolvedType;
|
|
51955
51982
|
}
|
|
51956
51983
|
return result;
|
|
51957
51984
|
}
|
|
@@ -52228,7 +52255,7 @@ ${lanes.join("\n")}
|
|
|
52228
52255
|
const importMetaType = getGlobalImportMetaType();
|
|
52229
52256
|
const metaPropertySymbol = createSymbol(4 /* Property */, "meta", 8 /* Readonly */);
|
|
52230
52257
|
metaPropertySymbol.parent = symbol;
|
|
52231
|
-
metaPropertySymbol.type = importMetaType;
|
|
52258
|
+
metaPropertySymbol.links.type = importMetaType;
|
|
52232
52259
|
const members = createSymbolTable([metaPropertySymbol]);
|
|
52233
52260
|
symbol.members = members;
|
|
52234
52261
|
deferredGlobalImportMetaExpressionType = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
@@ -52453,8 +52480,8 @@ ${lanes.join("\n")}
|
|
|
52453
52480
|
"" + i,
|
|
52454
52481
|
readonly ? 8 /* Readonly */ : 0
|
|
52455
52482
|
);
|
|
52456
|
-
property.tupleLabelDeclaration = namedMemberDeclarations == null ? void 0 : namedMemberDeclarations[i];
|
|
52457
|
-
property.type = typeParameter;
|
|
52483
|
+
property.links.tupleLabelDeclaration = namedMemberDeclarations == null ? void 0 : namedMemberDeclarations[i];
|
|
52484
|
+
property.links.type = typeParameter;
|
|
52458
52485
|
properties.push(property);
|
|
52459
52486
|
}
|
|
52460
52487
|
}
|
|
@@ -52462,12 +52489,12 @@ ${lanes.join("\n")}
|
|
|
52462
52489
|
const fixedLength = properties.length;
|
|
52463
52490
|
const lengthSymbol = createSymbol(4 /* Property */, "length", readonly ? 8 /* Readonly */ : 0);
|
|
52464
52491
|
if (combinedFlags & 12 /* Variable */) {
|
|
52465
|
-
lengthSymbol.type = numberType;
|
|
52492
|
+
lengthSymbol.links.type = numberType;
|
|
52466
52493
|
} else {
|
|
52467
52494
|
const literalTypes = [];
|
|
52468
52495
|
for (let i = minLength; i <= arity; i++)
|
|
52469
52496
|
literalTypes.push(getNumberLiteralType(i));
|
|
52470
|
-
lengthSymbol.type = getUnionType(literalTypes);
|
|
52497
|
+
lengthSymbol.links.type = getUnionType(literalTypes);
|
|
52471
52498
|
}
|
|
52472
52499
|
properties.push(lengthSymbol);
|
|
52473
52500
|
const type = createObjectType(8 /* Tuple */ | 4 /* Reference */);
|
|
@@ -53993,6 +54020,13 @@ ${lanes.join("\n")}
|
|
|
53993
54020
|
if (meaning === 111551 /* Value */) {
|
|
53994
54021
|
return getTypeOfSymbol(symbol);
|
|
53995
54022
|
} else {
|
|
54023
|
+
const type = tryGetDeclaredTypeOfSymbol(resolvedSymbol);
|
|
54024
|
+
const typeParameters = type && getTypeParametersForTypeAndSymbol(type, resolvedSymbol);
|
|
54025
|
+
if (node.typeArguments && typeParameters) {
|
|
54026
|
+
addLazyDiagnostic(() => {
|
|
54027
|
+
checkTypeArgumentConstraints(node, typeParameters);
|
|
54028
|
+
});
|
|
54029
|
+
}
|
|
53996
54030
|
return getTypeReferenceType(node, resolvedSymbol);
|
|
53997
54031
|
}
|
|
53998
54032
|
}
|
|
@@ -54054,10 +54088,10 @@ ${lanes.join("\n")}
|
|
|
54054
54088
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
54055
54089
|
const flags = 4 /* Property */ | 16777216 /* Optional */;
|
|
54056
54090
|
const result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));
|
|
54057
|
-
result.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), true);
|
|
54091
|
+
result.links.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), true);
|
|
54058
54092
|
result.declarations = prop.declarations;
|
|
54059
|
-
result.nameType = getSymbolLinks(prop).nameType;
|
|
54060
|
-
result.syntheticOrigin = prop;
|
|
54093
|
+
result.links.nameType = getSymbolLinks(prop).nameType;
|
|
54094
|
+
result.links.syntheticOrigin = prop;
|
|
54061
54095
|
members.set(prop.escapedName, result);
|
|
54062
54096
|
}
|
|
54063
54097
|
}
|
|
@@ -54124,11 +54158,11 @@ ${lanes.join("\n")}
|
|
|
54124
54158
|
const declarations = concatenate(leftProp.declarations, rightProp.declarations);
|
|
54125
54159
|
const flags = 4 /* Property */ | leftProp.flags & 16777216 /* Optional */;
|
|
54126
54160
|
const result = createSymbol(flags, leftProp.escapedName);
|
|
54127
|
-
result.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], 2 /* Subtype */);
|
|
54128
|
-
result.leftSpread = leftProp;
|
|
54129
|
-
result.rightSpread = rightProp;
|
|
54161
|
+
result.links.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], 2 /* Subtype */);
|
|
54162
|
+
result.links.leftSpread = leftProp;
|
|
54163
|
+
result.links.rightSpread = rightProp;
|
|
54130
54164
|
result.declarations = declarations;
|
|
54131
|
-
result.nameType = getSymbolLinks(leftProp).nameType;
|
|
54165
|
+
result.links.nameType = getSymbolLinks(leftProp).nameType;
|
|
54132
54166
|
members.set(leftProp.escapedName, result);
|
|
54133
54167
|
}
|
|
54134
54168
|
} else {
|
|
@@ -54150,10 +54184,10 @@ ${lanes.join("\n")}
|
|
|
54150
54184
|
}
|
|
54151
54185
|
const flags = 4 /* Property */ | prop.flags & 16777216 /* Optional */;
|
|
54152
54186
|
const result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));
|
|
54153
|
-
result.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);
|
|
54187
|
+
result.links.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);
|
|
54154
54188
|
result.declarations = prop.declarations;
|
|
54155
|
-
result.nameType = getSymbolLinks(prop).nameType;
|
|
54156
|
-
result.syntheticOrigin = prop;
|
|
54189
|
+
result.links.nameType = getSymbolLinks(prop).nameType;
|
|
54190
|
+
result.links.syntheticOrigin = prop;
|
|
54157
54191
|
return result;
|
|
54158
54192
|
}
|
|
54159
54193
|
function getIndexInfoWithReadonly(info, readonly) {
|
|
@@ -54518,13 +54552,13 @@ ${lanes.join("\n")}
|
|
|
54518
54552
|
const result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | getCheckFlags(symbol) & (8 /* Readonly */ | 4096 /* Late */ | 16384 /* OptionalParameter */ | 32768 /* RestParameter */));
|
|
54519
54553
|
result.declarations = symbol.declarations;
|
|
54520
54554
|
result.parent = symbol.parent;
|
|
54521
|
-
result.target = symbol;
|
|
54522
|
-
result.mapper = mapper;
|
|
54555
|
+
result.links.target = symbol;
|
|
54556
|
+
result.links.mapper = mapper;
|
|
54523
54557
|
if (symbol.valueDeclaration) {
|
|
54524
54558
|
result.valueDeclaration = symbol.valueDeclaration;
|
|
54525
54559
|
}
|
|
54526
54560
|
if (links.nameType) {
|
|
54527
|
-
result.nameType = links.nameType;
|
|
54561
|
+
result.links.nameType = links.nameType;
|
|
54528
54562
|
}
|
|
54529
54563
|
return result;
|
|
54530
54564
|
}
|
|
@@ -57562,7 +57596,7 @@ ${lanes.join("\n")}
|
|
|
57562
57596
|
}
|
|
57563
57597
|
function forEachProperty2(prop, callback) {
|
|
57564
57598
|
if (getCheckFlags(prop) & 6 /* Synthetic */) {
|
|
57565
|
-
for (const t of prop.containingType.types) {
|
|
57599
|
+
for (const t of prop.links.containingType.types) {
|
|
57566
57600
|
const p = getPropertyOfType(t, prop.escapedName);
|
|
57567
57601
|
const result = p && forEachProperty2(p, callback);
|
|
57568
57602
|
if (result) {
|
|
@@ -57976,14 +58010,14 @@ ${lanes.join("\n")}
|
|
|
57976
58010
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
57977
58011
|
symbol.declarations = source.declarations;
|
|
57978
58012
|
symbol.parent = source.parent;
|
|
57979
|
-
symbol.type = type;
|
|
57980
|
-
symbol.target = source;
|
|
58013
|
+
symbol.links.type = type;
|
|
58014
|
+
symbol.links.target = source;
|
|
57981
58015
|
if (source.valueDeclaration) {
|
|
57982
58016
|
symbol.valueDeclaration = source.valueDeclaration;
|
|
57983
58017
|
}
|
|
57984
58018
|
const nameType = getSymbolLinks(source).nameType;
|
|
57985
58019
|
if (nameType) {
|
|
57986
|
-
symbol.nameType = nameType;
|
|
58020
|
+
symbol.links.nameType = nameType;
|
|
57987
58021
|
}
|
|
57988
58022
|
return symbol;
|
|
57989
58023
|
}
|
|
@@ -58364,7 +58398,7 @@ ${lanes.join("\n")}
|
|
|
58364
58398
|
}
|
|
58365
58399
|
const name = escapeLeadingUnderscores(t.value);
|
|
58366
58400
|
const literalProp = createSymbol(4 /* Property */, name);
|
|
58367
|
-
literalProp.type = anyType;
|
|
58401
|
+
literalProp.links.type = anyType;
|
|
58368
58402
|
if (t.symbol) {
|
|
58369
58403
|
literalProp.declarations = t.symbol.declarations;
|
|
58370
58404
|
literalProp.valueDeclaration = t.symbol.valueDeclaration;
|
|
@@ -58412,7 +58446,7 @@ ${lanes.join("\n")}
|
|
|
58412
58446
|
function getTypeOfReverseMappedSymbol(symbol) {
|
|
58413
58447
|
const links = getSymbolLinks(symbol);
|
|
58414
58448
|
if (!links.type) {
|
|
58415
|
-
links.type = inferReverseMappedType(symbol.propertyType, symbol.mappedType, symbol.constraintType);
|
|
58449
|
+
links.type = inferReverseMappedType(symbol.links.propertyType, symbol.links.mappedType, symbol.links.constraintType);
|
|
58416
58450
|
}
|
|
58417
58451
|
return links.type;
|
|
58418
58452
|
}
|
|
@@ -59395,10 +59429,10 @@ ${lanes.join("\n")}
|
|
|
59395
59429
|
if (type && type.flags & 1048576 /* Union */) {
|
|
59396
59430
|
const prop = getUnionOrIntersectionProperty(type, name);
|
|
59397
59431
|
if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) {
|
|
59398
|
-
if (prop.isDiscriminantProperty === void 0) {
|
|
59399
|
-
prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop));
|
|
59432
|
+
if (prop.links.isDiscriminantProperty === void 0) {
|
|
59433
|
+
prop.links.isDiscriminantProperty = (prop.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop));
|
|
59400
59434
|
}
|
|
59401
|
-
return !!prop.isDiscriminantProperty;
|
|
59435
|
+
return !!prop.links.isDiscriminantProperty;
|
|
59402
59436
|
}
|
|
59403
59437
|
}
|
|
59404
59438
|
return false;
|
|
@@ -59920,7 +59954,7 @@ ${lanes.join("\n")}
|
|
|
59920
59954
|
}
|
|
59921
59955
|
if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {
|
|
59922
59956
|
if (getCheckFlags(symbol) & 262144 /* Mapped */) {
|
|
59923
|
-
const origin = symbol.syntheticOrigin;
|
|
59957
|
+
const origin = symbol.links.syntheticOrigin;
|
|
59924
59958
|
if (origin && getExplicitTypeOfSymbol(origin)) {
|
|
59925
59959
|
return getTypeOfSymbol(symbol);
|
|
59926
59960
|
}
|
|
@@ -62001,7 +62035,7 @@ ${lanes.join("\n")}
|
|
|
62001
62035
|
return nameStr !== void 0 && getTypeOfPropertyOfContextualType(thisType, nameStr) || void 0;
|
|
62002
62036
|
}
|
|
62003
62037
|
function isCircularMappedProperty(symbol) {
|
|
62004
|
-
return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0);
|
|
62038
|
+
return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.links.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0);
|
|
62005
62039
|
}
|
|
62006
62040
|
function getTypeOfPropertyOfContextualType(type, name, nameType) {
|
|
62007
62041
|
return mapType(type, (t) => {
|
|
@@ -62423,14 +62457,14 @@ ${lanes.join("\n")}
|
|
|
62423
62457
|
1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0),
|
|
62424
62458
|
paramName || `arg${i}`
|
|
62425
62459
|
);
|
|
62426
|
-
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
62460
|
+
paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
62427
62461
|
params[i] = paramSymbol;
|
|
62428
62462
|
}
|
|
62429
62463
|
if (needsExtraRestElement) {
|
|
62430
62464
|
const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args");
|
|
62431
|
-
restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
62465
|
+
restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
62432
62466
|
if (shorter === right) {
|
|
62433
|
-
restParamSymbol.type = instantiateType(restParamSymbol.type, mapper);
|
|
62467
|
+
restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper);
|
|
62434
62468
|
}
|
|
62435
62469
|
params[longestCount] = restParamSymbol;
|
|
62436
62470
|
}
|
|
@@ -62661,6 +62695,7 @@ ${lanes.join("\n")}
|
|
|
62661
62695
|
return links.immediateTarget;
|
|
62662
62696
|
}
|
|
62663
62697
|
function checkObjectLiteral(node, checkMode) {
|
|
62698
|
+
var _a2;
|
|
62664
62699
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
62665
62700
|
checkGrammarObjectLiteralExpression(node, inDestructuringPattern);
|
|
62666
62701
|
const allPropertiesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
@@ -62703,7 +62738,7 @@ ${lanes.join("\n")}
|
|
|
62703
62738
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
62704
62739
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
62705
62740
|
if (nameType) {
|
|
62706
|
-
prop.nameType = nameType;
|
|
62741
|
+
prop.links.nameType = nameType;
|
|
62707
62742
|
}
|
|
62708
62743
|
if (inDestructuringPattern) {
|
|
62709
62744
|
const isOptional = memberDecl.kind === 299 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 300 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
|
|
@@ -62728,8 +62763,8 @@ ${lanes.join("\n")}
|
|
|
62728
62763
|
if (member.valueDeclaration) {
|
|
62729
62764
|
prop.valueDeclaration = member.valueDeclaration;
|
|
62730
62765
|
}
|
|
62731
|
-
prop.type = type;
|
|
62732
|
-
prop.target = member;
|
|
62766
|
+
prop.links.type = type;
|
|
62767
|
+
prop.links.target = member;
|
|
62733
62768
|
member = prop;
|
|
62734
62769
|
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
62735
62770
|
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 299 /* PropertyAssignment */ || memberDecl.kind === 171 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
|
|
@@ -62802,7 +62837,7 @@ ${lanes.join("\n")}
|
|
|
62802
62837
|
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
|
|
62803
62838
|
if (!(prop.flags & 16777216 /* Optional */)) {
|
|
62804
62839
|
error(
|
|
62805
|
-
prop.valueDeclaration || prop.bindingElement,
|
|
62840
|
+
prop.valueDeclaration || ((_a2 = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a2.links.bindingElement),
|
|
62806
62841
|
Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value
|
|
62807
62842
|
);
|
|
62808
62843
|
}
|
|
@@ -62912,8 +62947,8 @@ ${lanes.join("\n")}
|
|
|
62912
62947
|
if (member.valueDeclaration) {
|
|
62913
62948
|
attributeSymbol.valueDeclaration = member.valueDeclaration;
|
|
62914
62949
|
}
|
|
62915
|
-
attributeSymbol.type = exprType;
|
|
62916
|
-
attributeSymbol.target = member;
|
|
62950
|
+
attributeSymbol.links.type = exprType;
|
|
62951
|
+
attributeSymbol.links.target = member;
|
|
62917
62952
|
attributesTable.set(attributeSymbol.escapedName, attributeSymbol);
|
|
62918
62953
|
allAttributesTable == null ? void 0 : allAttributesTable.set(attributeSymbol.escapedName, attributeSymbol);
|
|
62919
62954
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
@@ -62961,7 +62996,7 @@ ${lanes.join("\n")}
|
|
|
62961
62996
|
const contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes, void 0);
|
|
62962
62997
|
const childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName);
|
|
62963
62998
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
62964
|
-
childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
62999
|
+
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
62965
63000
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(void 0, unescapeLeadingUnderscores(jsxChildrenPropertyName), void 0, void 0);
|
|
62966
63001
|
setParent(childrenPropSymbol.valueDeclaration, attributes);
|
|
62967
63002
|
childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol;
|
|
@@ -63067,7 +63102,7 @@ ${lanes.join("\n")}
|
|
|
63067
63102
|
return void 0;
|
|
63068
63103
|
}
|
|
63069
63104
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
63070
|
-
const errorMessage = isClassic ? Diagnostics.
|
|
63105
|
+
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;
|
|
63071
63106
|
const mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location);
|
|
63072
63107
|
const result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : void 0;
|
|
63073
63108
|
if (links) {
|
|
@@ -65472,7 +65507,7 @@ ${lanes.join("\n")}
|
|
|
65472
65507
|
returnNode ? factory.createTypeReferenceNode(returnNode, void 0) : factory.createKeywordTypeNode(131 /* AnyKeyword */)
|
|
65473
65508
|
);
|
|
65474
65509
|
const parameterSymbol = createSymbol(1 /* FunctionScopedVariable */, "props");
|
|
65475
|
-
parameterSymbol.type = result;
|
|
65510
|
+
parameterSymbol.links.type = result;
|
|
65476
65511
|
return createSignature(
|
|
65477
65512
|
declaration,
|
|
65478
65513
|
void 0,
|
|
@@ -65765,8 +65800,8 @@ ${lanes.join("\n")}
|
|
|
65765
65800
|
const memberTable = createSymbolTable();
|
|
65766
65801
|
const newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */);
|
|
65767
65802
|
newSymbol.parent = originalSymbol;
|
|
65768
|
-
newSymbol.nameType = getStringLiteralType("default");
|
|
65769
|
-
newSymbol.aliasTarget = resolveSymbol(symbol);
|
|
65803
|
+
newSymbol.links.nameType = getStringLiteralType("default");
|
|
65804
|
+
newSymbol.links.aliasTarget = resolveSymbol(symbol);
|
|
65770
65805
|
memberTable.set("default" /* Default */, newSymbol);
|
|
65771
65806
|
return createAnonymousType(anonymousSymbol, memberTable, emptyArray, emptyArray, emptyArray);
|
|
65772
65807
|
}
|
|
@@ -65792,7 +65827,7 @@ ${lanes.join("\n")}
|
|
|
65792
65827
|
if (hasSyntheticDefault) {
|
|
65793
65828
|
const anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
65794
65829
|
const defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol);
|
|
65795
|
-
anonymousSymbol.type = defaultContainingObject;
|
|
65830
|
+
anonymousSymbol.links.type = defaultContainingObject;
|
|
65796
65831
|
synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, false) : defaultContainingObject;
|
|
65797
65832
|
} else {
|
|
65798
65833
|
synthType.syntheticType = type;
|
|
@@ -66327,7 +66362,7 @@ ${lanes.join("\n")}
|
|
|
66327
66362
|
const symbol = createSymbol(0 /* None */, "NewTargetExpression");
|
|
66328
66363
|
const targetPropertySymbol = createSymbol(4 /* Property */, "target", 8 /* Readonly */);
|
|
66329
66364
|
targetPropertySymbol.parent = symbol;
|
|
66330
|
-
targetPropertySymbol.type = targetType;
|
|
66365
|
+
targetPropertySymbol.links.type = targetType;
|
|
66331
66366
|
const members = createSymbolTable([targetPropertySymbol]);
|
|
66332
66367
|
symbol.members = members;
|
|
66333
66368
|
return createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
@@ -68775,12 +68810,18 @@ ${lanes.join("\n")}
|
|
|
68775
68810
|
}
|
|
68776
68811
|
return result;
|
|
68777
68812
|
}
|
|
68813
|
+
function getTypeParametersForTypeAndSymbol(type, symbol) {
|
|
68814
|
+
if (!isErrorType(type)) {
|
|
68815
|
+
return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters || (getObjectFlags(type) & 4 /* Reference */ ? type.target.localTypeParameters : void 0);
|
|
68816
|
+
}
|
|
68817
|
+
return void 0;
|
|
68818
|
+
}
|
|
68778
68819
|
function getTypeParametersForTypeReference(node) {
|
|
68779
68820
|
const type = getTypeFromTypeReference(node);
|
|
68780
68821
|
if (!isErrorType(type)) {
|
|
68781
68822
|
const symbol = getNodeLinks(node).resolvedSymbol;
|
|
68782
68823
|
if (symbol) {
|
|
68783
|
-
return
|
|
68824
|
+
return getTypeParametersForTypeAndSymbol(type, symbol);
|
|
68784
68825
|
}
|
|
68785
68826
|
}
|
|
68786
68827
|
return void 0;
|
|
@@ -71859,7 +71900,7 @@ ${lanes.join("\n")}
|
|
|
71859
71900
|
);
|
|
71860
71901
|
}
|
|
71861
71902
|
function getTargetSymbol(s) {
|
|
71862
|
-
return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s;
|
|
71903
|
+
return getCheckFlags(s) & 1 /* Instantiated */ ? s.links.target : s;
|
|
71863
71904
|
}
|
|
71864
71905
|
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
|
|
71865
71906
|
return filter(symbol.declarations, (d) => d.kind === 260 /* ClassDeclaration */ || d.kind === 261 /* InterfaceDeclaration */);
|
|
@@ -73922,7 +73963,7 @@ ${lanes.join("\n")}
|
|
|
73922
73963
|
if (getCheckFlags(symbol) & 6 /* Synthetic */) {
|
|
73923
73964
|
return mapDefined(getSymbolLinks(symbol).containingType.types, (type) => getPropertyOfType(type, symbol.escapedName));
|
|
73924
73965
|
} else if (symbol.flags & 33554432 /* Transient */) {
|
|
73925
|
-
const { leftSpread, rightSpread, syntheticOrigin } = symbol;
|
|
73966
|
+
const { links: { leftSpread, rightSpread, syntheticOrigin } } = symbol;
|
|
73926
73967
|
return leftSpread ? [leftSpread, rightSpread] : syntheticOrigin ? [syntheticOrigin] : singleElementArray(tryGetTarget(symbol));
|
|
73927
73968
|
}
|
|
73928
73969
|
return void 0;
|
|
@@ -76221,7 +76262,7 @@ ${lanes.join("\n")}
|
|
|
76221
76262
|
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
|
|
76222
76263
|
};
|
|
76223
76264
|
}
|
|
76224
|
-
var ambientModuleSymbolRegex, anon, nextSymbolId, nextNodeId, nextMergeId, nextFlowId, TypeFacts, typeofNEFacts, CheckMode, SignatureCheckMode, isNotOverloadAndNotAccessor, intrinsicTypeKinds, JsxNames, SymbolTrackerImpl;
|
|
76265
|
+
var ambientModuleSymbolRegex, anon, nextSymbolId, nextNodeId, nextMergeId, nextFlowId, TypeFacts, typeofNEFacts, CheckMode, SignatureCheckMode, isNotOverloadAndNotAccessor, intrinsicTypeKinds, SymbolLinks, JsxNames, SymbolTrackerImpl;
|
|
76225
76266
|
var init_checker = __esm({
|
|
76226
76267
|
"src/compiler/checker.ts"() {
|
|
76227
76268
|
"use strict";
|
|
@@ -76351,6 +76392,8 @@ ${lanes.join("\n")}
|
|
|
76351
76392
|
Capitalize: 2 /* Capitalize */,
|
|
76352
76393
|
Uncapitalize: 3 /* Uncapitalize */
|
|
76353
76394
|
}));
|
|
76395
|
+
SymbolLinks = class {
|
|
76396
|
+
};
|
|
76354
76397
|
((JsxNames2) => {
|
|
76355
76398
|
JsxNames2.JSX = "JSX";
|
|
76356
76399
|
JsxNames2.IntrinsicElements = "IntrinsicElements";
|
|
@@ -81499,7 +81542,7 @@ ${lanes.join("\n")}
|
|
|
81499
81542
|
if (isClassWithConstructorReference) {
|
|
81500
81543
|
enableSubstitutionForClassAliases();
|
|
81501
81544
|
const alias = factory2.cloneNode(temp);
|
|
81502
|
-
alias.
|
|
81545
|
+
alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
|
|
81503
81546
|
classAliases[getOriginalNodeId(node)] = alias;
|
|
81504
81547
|
}
|
|
81505
81548
|
setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression));
|
|
@@ -91887,7 +91930,7 @@ ${lanes.join("\n")}
|
|
|
91887
91930
|
return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
|
|
91888
91931
|
}
|
|
91889
91932
|
return node;
|
|
91890
|
-
} else if (!(isGeneratedIdentifier(node) && !(node.
|
|
91933
|
+
} else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
|
|
91891
91934
|
const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
|
|
91892
91935
|
if (exportContainer && exportContainer.kind === 308 /* SourceFile */) {
|
|
91893
91936
|
return setTextRange(
|
|
@@ -99746,10 +99789,10 @@ ${lanes.join("\n")}
|
|
|
99746
99789
|
}
|
|
99747
99790
|
}
|
|
99748
99791
|
function generateName(name) {
|
|
99749
|
-
if ((name.
|
|
99750
|
-
return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.
|
|
99792
|
+
if ((name.autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) {
|
|
99793
|
+
return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerate.flags, name.autoGenerate.prefix, name.autoGenerate.suffix);
|
|
99751
99794
|
} else {
|
|
99752
|
-
const autoGenerateId = name.
|
|
99795
|
+
const autoGenerateId = name.autoGenerate.id;
|
|
99753
99796
|
return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name));
|
|
99754
99797
|
}
|
|
99755
99798
|
}
|
|
@@ -99932,26 +99975,26 @@ ${lanes.join("\n")}
|
|
|
99932
99975
|
}
|
|
99933
99976
|
}
|
|
99934
99977
|
function makeName(name) {
|
|
99935
|
-
const prefix = formatGeneratedNamePart(name.
|
|
99936
|
-
const suffix = formatGeneratedNamePart(name.
|
|
99937
|
-
switch (name.
|
|
99978
|
+
const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName);
|
|
99979
|
+
const suffix = formatGeneratedNamePart(name.autoGenerate.suffix);
|
|
99980
|
+
switch (name.autoGenerate.flags & 7 /* KindMask */) {
|
|
99938
99981
|
case 1 /* Auto */:
|
|
99939
|
-
return makeTempVariableName(TempFlags.Auto, !!(name.
|
|
99982
|
+
return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
|
|
99940
99983
|
case 2 /* Loop */:
|
|
99941
99984
|
Debug.assertNode(name, isIdentifier);
|
|
99942
|
-
return makeTempVariableName(TempFlags._i, !!(name.
|
|
99985
|
+
return makeTempVariableName(TempFlags._i, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), false, prefix, suffix);
|
|
99943
99986
|
case 3 /* Unique */:
|
|
99944
99987
|
return makeUniqueName2(
|
|
99945
99988
|
idText(name),
|
|
99946
|
-
name.
|
|
99947
|
-
!!(name.
|
|
99948
|
-
!!(name.
|
|
99989
|
+
name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
|
|
99990
|
+
!!(name.autoGenerate.flags & 16 /* Optimistic */),
|
|
99991
|
+
!!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */),
|
|
99949
99992
|
isPrivateIdentifier(name),
|
|
99950
99993
|
prefix,
|
|
99951
99994
|
suffix
|
|
99952
99995
|
);
|
|
99953
99996
|
}
|
|
99954
|
-
return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(name.
|
|
99997
|
+
return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(name.autoGenerate.flags & 7 /* KindMask */, GeneratedIdentifierFlags, true)}.`);
|
|
99955
99998
|
}
|
|
99956
99999
|
function pipelineEmitWithComments(hint, node) {
|
|
99957
100000
|
const pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node);
|
|
@@ -101534,19 +101577,20 @@ ${lanes.join("\n")}
|
|
|
101534
101577
|
return false;
|
|
101535
101578
|
return optionsHaveChanges(program.getCompilerOptions(), newOptions, sourceFileAffectingCompilerOptions);
|
|
101536
101579
|
}
|
|
101537
|
-
function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics) {
|
|
101580
|
+
function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics, typeScriptVersion3) {
|
|
101538
101581
|
return {
|
|
101539
101582
|
rootNames,
|
|
101540
101583
|
options,
|
|
101541
101584
|
host,
|
|
101542
101585
|
oldProgram,
|
|
101543
|
-
configFileParsingDiagnostics
|
|
101586
|
+
configFileParsingDiagnostics,
|
|
101587
|
+
typeScriptVersion: typeScriptVersion3
|
|
101544
101588
|
};
|
|
101545
101589
|
}
|
|
101546
101590
|
function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
|
|
101547
101591
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
101548
101592
|
const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
|
|
101549
|
-
const { rootNames, options, configFileParsingDiagnostics, projectReferences } = createProgramOptions;
|
|
101593
|
+
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } = createProgramOptions;
|
|
101550
101594
|
let { oldProgram } = createProgramOptions;
|
|
101551
101595
|
let processingDefaultLibFiles;
|
|
101552
101596
|
let processingOtherFiles;
|
|
@@ -103305,7 +103349,7 @@ ${lanes.join("\n")}
|
|
|
103305
103349
|
i++;
|
|
103306
103350
|
}
|
|
103307
103351
|
const resolveFrom = combinePaths(currentDirectory, `__lib_node_modules_lookup_${libFileName}__.ts`);
|
|
103308
|
-
const localOverrideModuleResult = resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: 2 /*
|
|
103352
|
+
const localOverrideModuleResult = resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: 2 /* Node10 */ }, host, moduleResolutionCache);
|
|
103309
103353
|
if (localOverrideModuleResult == null ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
103310
103354
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
103311
103355
|
}
|
|
@@ -103478,6 +103522,7 @@ ${lanes.join("\n")}
|
|
|
103478
103522
|
} else if (options.incremental && !outputFile && !options.configFilePath) {
|
|
103479
103523
|
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
|
|
103480
103524
|
}
|
|
103525
|
+
verifyDeprecatedCompilerOptions();
|
|
103481
103526
|
verifyProjectReferences();
|
|
103482
103527
|
if (options.composite) {
|
|
103483
103528
|
const rootPaths = new Set(rootNames.map(toPath3));
|
|
@@ -103588,8 +103633,8 @@ ${lanes.join("\n")}
|
|
|
103588
103633
|
}
|
|
103589
103634
|
}
|
|
103590
103635
|
if (getResolveJsonModule(options)) {
|
|
103591
|
-
if (getEmitModuleResolutionKind(options)
|
|
103592
|
-
createDiagnosticForOptionName(Diagnostics.
|
|
103636
|
+
if (getEmitModuleResolutionKind(options) === 1 /* Classic */) {
|
|
103637
|
+
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic, "resolveJsonModule");
|
|
103593
103638
|
} else if (!hasJsonModuleEmitEnabled(options)) {
|
|
103594
103639
|
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext, "resolveJsonModule", "module");
|
|
103595
103640
|
}
|
|
@@ -103697,6 +103742,56 @@ ${lanes.join("\n")}
|
|
|
103697
103742
|
}
|
|
103698
103743
|
}
|
|
103699
103744
|
}
|
|
103745
|
+
function verifyDeprecatedCompilerOptions() {
|
|
103746
|
+
const version2 = typeScriptVersion3 || versionMajorMinor;
|
|
103747
|
+
const ignoreDeprecations = options.ignoreDeprecations;
|
|
103748
|
+
if (ignoreDeprecations) {
|
|
103749
|
+
if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) {
|
|
103750
|
+
return;
|
|
103751
|
+
} else {
|
|
103752
|
+
createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations);
|
|
103753
|
+
}
|
|
103754
|
+
}
|
|
103755
|
+
if (options.target === 0 /* ES3 */) {
|
|
103756
|
+
createDeprecatedDiagnosticForOption(version2, "target", "ES3");
|
|
103757
|
+
}
|
|
103758
|
+
if (options.noImplicitUseStrict) {
|
|
103759
|
+
createDeprecatedDiagnosticForOption(version2, "noImplicitUseStrict");
|
|
103760
|
+
}
|
|
103761
|
+
if (options.keyofStringsOnly) {
|
|
103762
|
+
createDeprecatedDiagnosticForOption(version2, "keyofStringsOnly");
|
|
103763
|
+
}
|
|
103764
|
+
if (options.suppressExcessPropertyErrors) {
|
|
103765
|
+
createDeprecatedDiagnosticForOption(version2, "suppressExcessPropertyErrors");
|
|
103766
|
+
}
|
|
103767
|
+
if (options.suppressImplicitAnyIndexErrors) {
|
|
103768
|
+
createDeprecatedDiagnosticForOption(version2, "suppressImplicitAnyIndexErrors");
|
|
103769
|
+
}
|
|
103770
|
+
if (options.noStrictGenericChecks) {
|
|
103771
|
+
createDeprecatedDiagnosticForOption(version2, "noStrictGenericChecks");
|
|
103772
|
+
}
|
|
103773
|
+
if (options.charset) {
|
|
103774
|
+
createDeprecatedDiagnosticForOption(version2, "charset");
|
|
103775
|
+
}
|
|
103776
|
+
if (options.out) {
|
|
103777
|
+
createDeprecatedDiagnosticForOption(version2, "out");
|
|
103778
|
+
}
|
|
103779
|
+
}
|
|
103780
|
+
function createDeprecatedDiagnosticForOption(version2, name, value) {
|
|
103781
|
+
if (version2 === "6.0" /* v6_0 */) {
|
|
103782
|
+
createDiagnosticForOption(!value, name, void 0, Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name);
|
|
103783
|
+
} else {
|
|
103784
|
+
createDiagnosticForOption(
|
|
103785
|
+
!value,
|
|
103786
|
+
name,
|
|
103787
|
+
void 0,
|
|
103788
|
+
Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error,
|
|
103789
|
+
value || name,
|
|
103790
|
+
"5.5" /* v5_5 */,
|
|
103791
|
+
"5.0" /* v5_0 */
|
|
103792
|
+
);
|
|
103793
|
+
}
|
|
103794
|
+
}
|
|
103700
103795
|
function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
|
|
103701
103796
|
var _a3;
|
|
103702
103797
|
let fileIncludeReasons;
|
|
@@ -112123,7 +112218,7 @@ ${lanes.join("\n")}
|
|
|
112123
112218
|
};
|
|
112124
112219
|
}
|
|
112125
112220
|
function moduleResolutionUsesNodeModules(moduleResolution) {
|
|
112126
|
-
return moduleResolution === 2 /*
|
|
112221
|
+
return moduleResolution === 2 /* Node10 */ || moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */;
|
|
112127
112222
|
}
|
|
112128
112223
|
function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) {
|
|
112129
112224
|
return defaultImport || namedImports && namedImports.length ? makeImport(defaultImport, namedImports, moduleSpecifier, quotePreference) : void 0;
|
|
@@ -112576,18 +112671,15 @@ ${lanes.join("\n")}
|
|
|
112576
112671
|
}
|
|
112577
112672
|
function getSymbolTarget(symbol, checker) {
|
|
112578
112673
|
let next = symbol;
|
|
112579
|
-
while (isAliasSymbol(next) ||
|
|
112580
|
-
if (
|
|
112581
|
-
next = next.target;
|
|
112674
|
+
while (isAliasSymbol(next) || isTransientSymbol(next) && next.links.target) {
|
|
112675
|
+
if (isTransientSymbol(next) && next.links.target) {
|
|
112676
|
+
next = next.links.target;
|
|
112582
112677
|
} else {
|
|
112583
112678
|
next = skipAlias(next, checker);
|
|
112584
112679
|
}
|
|
112585
112680
|
}
|
|
112586
112681
|
return next;
|
|
112587
112682
|
}
|
|
112588
|
-
function isTransientSymbol2(symbol) {
|
|
112589
|
-
return (symbol.flags & 33554432 /* Transient */) !== 0;
|
|
112590
|
-
}
|
|
112591
112683
|
function isAliasSymbol(symbol) {
|
|
112592
112684
|
return (symbol.flags & 2097152 /* Alias */) !== 0;
|
|
112593
112685
|
}
|
|
@@ -118836,6 +118928,8 @@ ${lanes.join("\n")}
|
|
|
118836
118928
|
};
|
|
118837
118929
|
SymbolObject = class {
|
|
118838
118930
|
constructor(flags, name) {
|
|
118931
|
+
this.id = 0;
|
|
118932
|
+
this.mergeId = 0;
|
|
118839
118933
|
this.flags = flags;
|
|
118840
118934
|
this.escapedName = name;
|
|
118841
118935
|
}
|
|
@@ -118857,8 +118951,8 @@ ${lanes.join("\n")}
|
|
|
118857
118951
|
getDocumentationComment(checker) {
|
|
118858
118952
|
if (!this.documentationComment) {
|
|
118859
118953
|
this.documentationComment = emptyArray;
|
|
118860
|
-
if (!this.declarations && this.target && this.target.tupleLabelDeclaration) {
|
|
118861
|
-
const labelDecl = this.target.tupleLabelDeclaration;
|
|
118954
|
+
if (!this.declarations && isTransientSymbol(this) && this.links.target && isTransientSymbol(this.links.target) && this.links.target.links.tupleLabelDeclaration) {
|
|
118955
|
+
const labelDecl = this.links.target.links.tupleLabelDeclaration;
|
|
118862
118956
|
this.documentationComment = getDocumentationComment([labelDecl], checker);
|
|
118863
118957
|
} else {
|
|
118864
118958
|
this.documentationComment = getDocumentationComment(this.declarations, checker);
|
|
@@ -124386,7 +124480,7 @@ ${lanes.join("\n")}
|
|
|
124386
124480
|
}
|
|
124387
124481
|
function isFixPossiblyReExportingImportingFile(fix, importingFile, compilerOptions, toPath3) {
|
|
124388
124482
|
var _a2;
|
|
124389
|
-
if (fix.isReExport && ((_a2 = fix.exportInfo) == null ? void 0 : _a2.moduleFileName) && getEmitModuleResolutionKind(compilerOptions) === 2 /*
|
|
124483
|
+
if (fix.isReExport && ((_a2 = fix.exportInfo) == null ? void 0 : _a2.moduleFileName) && getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */ && isIndexFileName(fix.exportInfo.moduleFileName)) {
|
|
124390
124484
|
const reExportDir = toPath3(getDirectoryPath(fix.exportInfo.moduleFileName));
|
|
124391
124485
|
return startsWith(importingFile.path, reExportDir);
|
|
124392
124486
|
}
|
|
@@ -125601,7 +125695,7 @@ ${lanes.join("\n")}
|
|
|
125601
125695
|
// src/services/codefixes/returnValueCorrect.ts
|
|
125602
125696
|
function createObjectTypeFromLabeledExpression(checker, label, expression) {
|
|
125603
125697
|
const member = checker.createSymbol(4 /* Property */, label.escapedText);
|
|
125604
|
-
member.type = checker.getTypeAtLocation(expression);
|
|
125698
|
+
member.links.type = checker.getTypeAtLocation(expression);
|
|
125605
125699
|
const members = createSymbolTable([member]);
|
|
125606
125700
|
return checker.createAnonymousType(void 0, members, [], [], []);
|
|
125607
125701
|
}
|
|
@@ -128414,7 +128508,7 @@ ${lanes.join("\n")}
|
|
|
128414
128508
|
const members = mapEntries(props, (name, types) => {
|
|
128415
128509
|
const isOptional = types.length < anons.length ? 16777216 /* Optional */ : 0;
|
|
128416
128510
|
const s = checker.createSymbol(4 /* Property */ | isOptional, name);
|
|
128417
|
-
s.type = checker.getUnionType(types);
|
|
128511
|
+
s.links.type = checker.getUnionType(types);
|
|
128418
128512
|
return [name, s];
|
|
128419
128513
|
});
|
|
128420
128514
|
const indexInfos = [];
|
|
@@ -128468,7 +128562,7 @@ ${lanes.join("\n")}
|
|
|
128468
128562
|
if (usage.properties) {
|
|
128469
128563
|
usage.properties.forEach((u, name) => {
|
|
128470
128564
|
const symbol = checker.createSymbol(4 /* Property */, name);
|
|
128471
|
-
symbol.type = combineFromUsage(u);
|
|
128565
|
+
symbol.links.type = combineFromUsage(u);
|
|
128472
128566
|
members.set(name, symbol);
|
|
128473
128567
|
});
|
|
128474
128568
|
}
|
|
@@ -128544,6 +128638,7 @@ ${lanes.join("\n")}
|
|
|
128544
128638
|
return [];
|
|
128545
128639
|
}
|
|
128546
128640
|
function inferFromSignatures(genericSig, usageSig, typeParameter) {
|
|
128641
|
+
var _a2;
|
|
128547
128642
|
const types = [];
|
|
128548
128643
|
for (let i = 0; i < genericSig.parameters.length; i++) {
|
|
128549
128644
|
const genericParam = genericSig.parameters[i];
|
|
@@ -128557,7 +128652,7 @@ ${lanes.join("\n")}
|
|
|
128557
128652
|
if (elementType) {
|
|
128558
128653
|
genericParamType = elementType;
|
|
128559
128654
|
}
|
|
128560
|
-
const targetType = usageParam.type || (usageParam.valueDeclaration ? checker.getTypeOfSymbolAtLocation(usageParam, usageParam.valueDeclaration) : checker.getAnyType());
|
|
128655
|
+
const targetType = ((_a2 = tryCast(usageParam, isTransientSymbol)) == null ? void 0 : _a2.links.type) || (usageParam.valueDeclaration ? checker.getTypeOfSymbolAtLocation(usageParam, usageParam.valueDeclaration) : checker.getAnyType());
|
|
128561
128656
|
types.push(...inferTypeParameters(genericParamType, targetType, typeParameter));
|
|
128562
128657
|
}
|
|
128563
128658
|
const genericReturn = checker.getReturnTypeOfSignature(genericSig);
|
|
@@ -128573,7 +128668,7 @@ ${lanes.join("\n")}
|
|
|
128573
128668
|
const length2 = Math.max(...calls.map((c) => c.argumentTypes.length));
|
|
128574
128669
|
for (let i = 0; i < length2; i++) {
|
|
128575
128670
|
const symbol = checker.createSymbol(1 /* FunctionScopedVariable */, escapeLeadingUnderscores(`arg${i}`));
|
|
128576
|
-
symbol.type = combineTypes(calls.map((call) => call.argumentTypes[i] || checker.getUndefinedType()));
|
|
128671
|
+
symbol.links.type = combineTypes(calls.map((call) => call.argumentTypes[i] || checker.getUndefinedType()));
|
|
128577
128672
|
if (calls.some((call) => call.argumentTypes[i] === void 0)) {
|
|
128578
128673
|
symbol.flags |= 16777216 /* Optional */;
|
|
128579
128674
|
}
|
|
@@ -129559,11 +129654,11 @@ ${lanes.join("\n")}
|
|
|
129559
129654
|
}
|
|
129560
129655
|
function getImportCodeFixesForExpression(context, expr) {
|
|
129561
129656
|
const type = context.program.getTypeChecker().getTypeAtLocation(expr);
|
|
129562
|
-
if (!(type.symbol && type.symbol.originatingImport)) {
|
|
129657
|
+
if (!(type.symbol && isTransientSymbol(type.symbol) && type.symbol.links.originatingImport)) {
|
|
129563
129658
|
return [];
|
|
129564
129659
|
}
|
|
129565
129660
|
const fixes = [];
|
|
129566
|
-
const relatedImport = type.symbol.originatingImport;
|
|
129661
|
+
const relatedImport = type.symbol.links.originatingImport;
|
|
129567
129662
|
if (!isImportCall(relatedImport)) {
|
|
129568
129663
|
addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport));
|
|
129569
129664
|
}
|
|
@@ -143833,7 +143928,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
143833
143928
|
}
|
|
143834
143929
|
});
|
|
143835
143930
|
const lists = checker.getExpandedParameters(candidateSignature);
|
|
143836
|
-
const isVariadic = !checker.hasEffectiveRestParameter(candidateSignature) ? (_) => false : lists.length === 1 ? (_) => true : (pList) =>
|
|
143931
|
+
const isVariadic = !checker.hasEffectiveRestParameter(candidateSignature) ? (_) => false : lists.length === 1 ? (_) => true : (pList) => {
|
|
143932
|
+
var _a2;
|
|
143933
|
+
return !!(pList.length && ((_a2 = tryCast(pList[pList.length - 1], isTransientSymbol)) == null ? void 0 : _a2.links.checkFlags) & 32768 /* RestParameter */);
|
|
143934
|
+
};
|
|
143837
143935
|
return lists.map((parameterList) => ({
|
|
143838
143936
|
isVariadic: isVariadic(parameterList),
|
|
143839
143937
|
parameters: parameterList.map((p) => createSignatureHelpParameterForParameter(p, checker, enclosingDeclaration, sourceFile, printer)),
|
|
@@ -143847,7 +143945,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
143847
143945
|
printer.writeNode(4 /* Unspecified */, param, sourceFile, writer);
|
|
143848
143946
|
});
|
|
143849
143947
|
const isOptional = checker.isOptionalParameter(parameter.valueDeclaration);
|
|
143850
|
-
const isRest = !!(parameter.checkFlags & 32768 /* RestParameter */);
|
|
143948
|
+
const isRest = isTransientSymbol(parameter) && !!(parameter.links.checkFlags & 32768 /* RestParameter */);
|
|
143851
143949
|
return { name: parameter.name, documentation: parameter.getDocumentationComment(checker), displayParts, isOptional, isRest };
|
|
143852
143950
|
}
|
|
143853
143951
|
function createSignatureHelpParameterForTypeParameter(typeParameter, checker, enclosingDeclaration, sourceFile, printer) {
|
|
@@ -144161,7 +144259,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
144161
144259
|
if (flags & 131072 /* Signature */)
|
|
144162
144260
|
return "index" /* indexSignatureElement */;
|
|
144163
144261
|
if (flags & 4 /* Property */) {
|
|
144164
|
-
if (flags & 33554432 /* Transient */ && symbol.checkFlags & 6 /* Synthetic */) {
|
|
144262
|
+
if (flags & 33554432 /* Transient */ && symbol.links.checkFlags & 6 /* Synthetic */) {
|
|
144165
144263
|
const unionPropertyKind = forEach(typeChecker.getRootSymbols(symbol), (rootSymbol) => {
|
|
144166
144264
|
const rootSymbolFlags = rootSymbol.getFlags();
|
|
144167
144265
|
if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) {
|
|
@@ -144541,8 +144639,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
144541
144639
|
} else {
|
|
144542
144640
|
addRange(displayParts, typeToDisplayParts(typeChecker, type, enclosingDeclaration));
|
|
144543
144641
|
}
|
|
144544
|
-
if (symbol.target && symbol.target.tupleLabelDeclaration) {
|
|
144545
|
-
const labelDecl = symbol.target.tupleLabelDeclaration;
|
|
144642
|
+
if (isTransientSymbol(symbol) && symbol.links.target && isTransientSymbol(symbol.links.target) && symbol.links.target.links.tupleLabelDeclaration) {
|
|
144643
|
+
const labelDecl = symbol.links.target.links.tupleLabelDeclaration;
|
|
144546
144644
|
Debug.assertNode(labelDecl.name, isIdentifier);
|
|
144547
144645
|
displayParts.push(spacePart());
|
|
144548
144646
|
displayParts.push(punctuationPart(20 /* OpenParenToken */));
|
|
@@ -149891,6 +149989,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
149891
149989
|
ContextFlags: () => ContextFlags,
|
|
149892
149990
|
CoreServicesShimHostAdapter: () => CoreServicesShimHostAdapter,
|
|
149893
149991
|
Debug: () => Debug,
|
|
149992
|
+
DeprecationVersion: () => DeprecationVersion,
|
|
149894
149993
|
DiagnosticCategory: () => DiagnosticCategory,
|
|
149895
149994
|
Diagnostics: () => Diagnostics,
|
|
149896
149995
|
DocumentHighlights: () => DocumentHighlights,
|