@typescript-deploys/pr-build 5.0.0-pr-51884-12 → 5.0.0-pr-51753-8
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 +385 -238
- package/lib/tsserver.js +449 -278
- package/lib/tsserverlibrary.d.ts +19 -11
- package/lib/tsserverlibrary.js +446 -280
- package/lib/typescript.d.ts +19 -11
- package/lib/typescript.js +440 -279
- package/lib/typingsInstaller.js +111 -71
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20221216`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -3342,14 +3342,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
|
|
|
3342
3342
|
SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 350] = "JSDocSeeTag";
|
|
3343
3343
|
SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 351] = "JSDocPropertyTag";
|
|
3344
3344
|
SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 352] = "JSDocThrowsTag";
|
|
3345
|
-
SyntaxKind4[SyntaxKind4["
|
|
3346
|
-
SyntaxKind4[SyntaxKind4["
|
|
3347
|
-
SyntaxKind4[SyntaxKind4["
|
|
3348
|
-
SyntaxKind4[SyntaxKind4["
|
|
3349
|
-
SyntaxKind4[SyntaxKind4["
|
|
3350
|
-
SyntaxKind4[SyntaxKind4["
|
|
3351
|
-
SyntaxKind4[SyntaxKind4["
|
|
3352
|
-
SyntaxKind4[SyntaxKind4["
|
|
3345
|
+
SyntaxKind4[SyntaxKind4["JSDocSatisfiesTag"] = 353] = "JSDocSatisfiesTag";
|
|
3346
|
+
SyntaxKind4[SyntaxKind4["SyntaxList"] = 354] = "SyntaxList";
|
|
3347
|
+
SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 355] = "NotEmittedStatement";
|
|
3348
|
+
SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression";
|
|
3349
|
+
SyntaxKind4[SyntaxKind4["CommaListExpression"] = 357] = "CommaListExpression";
|
|
3350
|
+
SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 358] = "MergeDeclarationMarker";
|
|
3351
|
+
SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 359] = "EndOfDeclarationMarker";
|
|
3352
|
+
SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 360] = "SyntheticReferenceExpression";
|
|
3353
|
+
SyntaxKind4[SyntaxKind4["Count"] = 361] = "Count";
|
|
3353
3354
|
SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
|
|
3354
3355
|
SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
|
|
3355
3356
|
SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
|
|
@@ -3714,7 +3715,7 @@ function diagnosticCategoryName(d, lowerCase = true) {
|
|
|
3714
3715
|
}
|
|
3715
3716
|
var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => {
|
|
3716
3717
|
ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic";
|
|
3717
|
-
ModuleResolutionKind2[ModuleResolutionKind2["
|
|
3718
|
+
ModuleResolutionKind2[ModuleResolutionKind2["Node10"] = 2] = "Node10";
|
|
3718
3719
|
ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16";
|
|
3719
3720
|
ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext";
|
|
3720
3721
|
ModuleResolutionKind2[ModuleResolutionKind2["Bundler"] = 100] = "Bundler";
|
|
@@ -6425,7 +6426,7 @@ var Diagnostics = {
|
|
|
6425
6426
|
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."),
|
|
6426
6427
|
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."),
|
|
6427
6428
|
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."),
|
|
6428
|
-
|
|
6429
|
+
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?"),
|
|
6429
6430
|
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."),
|
|
6430
6431
|
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'?"),
|
|
6431
6432
|
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."),
|
|
@@ -6607,7 +6608,7 @@ var Diagnostics = {
|
|
|
6607
6608
|
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."),
|
|
6608
6609
|
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."),
|
|
6609
6610
|
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}'."),
|
|
6610
|
-
|
|
6611
|
+
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'."),
|
|
6611
6612
|
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'."),
|
|
6612
6613
|
Unknown_build_option_0: diag(5072, 1 /* Error */, "Unknown_build_option_0_5072", "Unknown build option '{0}'."),
|
|
6613
6614
|
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}."),
|
|
@@ -6638,6 +6639,9 @@ var Diagnostics = {
|
|
|
6638
6639
|
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'."),
|
|
6639
6640
|
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.`),
|
|
6640
6641
|
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."),
|
|
6642
|
+
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.`),
|
|
6643
|
+
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."),
|
|
6644
|
+
Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."),
|
|
6641
6645
|
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."),
|
|
6642
6646
|
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."),
|
|
6643
6647
|
Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
|
|
@@ -9888,6 +9892,9 @@ function getJSDocThisTag(node) {
|
|
|
9888
9892
|
function getJSDocReturnTag(node) {
|
|
9889
9893
|
return getFirstJSDocTag(node, isJSDocReturnTag);
|
|
9890
9894
|
}
|
|
9895
|
+
function getJSDocSatisfiesTag(node) {
|
|
9896
|
+
return getFirstJSDocTag(node, isJSDocSatisfiesTag);
|
|
9897
|
+
}
|
|
9891
9898
|
function getJSDocTypeTag(node) {
|
|
9892
9899
|
const tag = getFirstJSDocTag(node, isJSDocTypeTag);
|
|
9893
9900
|
if (tag && tag.typeExpression && tag.typeExpression.type) {
|
|
@@ -10103,10 +10110,10 @@ function isAssertionKey(node) {
|
|
|
10103
10110
|
return isStringLiteral(node) || isIdentifier(node);
|
|
10104
10111
|
}
|
|
10105
10112
|
function isGeneratedIdentifier(node) {
|
|
10106
|
-
return isIdentifier(node) &&
|
|
10113
|
+
return isIdentifier(node) && node.autoGenerate !== void 0;
|
|
10107
10114
|
}
|
|
10108
10115
|
function isGeneratedPrivateIdentifier(node) {
|
|
10109
|
-
return isPrivateIdentifier(node) &&
|
|
10116
|
+
return isPrivateIdentifier(node) && node.autoGenerate !== void 0;
|
|
10110
10117
|
}
|
|
10111
10118
|
function isPrivateIdentifierClassElementDeclaration(node) {
|
|
10112
10119
|
return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name);
|
|
@@ -10388,8 +10395,8 @@ function isExpressionKind(kind) {
|
|
|
10388
10395
|
case 227 /* SpreadElement */:
|
|
10389
10396
|
case 231 /* AsExpression */:
|
|
10390
10397
|
case 229 /* OmittedExpression */:
|
|
10391
|
-
case
|
|
10392
|
-
case
|
|
10398
|
+
case 357 /* CommaListExpression */:
|
|
10399
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
10393
10400
|
case 235 /* SatisfiesExpression */:
|
|
10394
10401
|
return true;
|
|
10395
10402
|
default:
|
|
@@ -10560,7 +10567,7 @@ function isDeclarationStatementKind(kind) {
|
|
|
10560
10567
|
return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */;
|
|
10561
10568
|
}
|
|
10562
10569
|
function isStatementKindButNotDeclarationKind(kind) {
|
|
10563
|
-
return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind ===
|
|
10570
|
+
return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 355 /* NotEmittedStatement */ || kind === 359 /* EndOfDeclarationMarker */ || kind === 358 /* MergeDeclarationMarker */;
|
|
10564
10571
|
}
|
|
10565
10572
|
function isDeclaration(node) {
|
|
10566
10573
|
if (node.kind === 165 /* TypeParameter */) {
|
|
@@ -11016,7 +11023,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
11016
11023
|
if (includeJsDoc && hasJSDocNodes(node)) {
|
|
11017
11024
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
11018
11025
|
}
|
|
11019
|
-
if (node.kind ===
|
|
11026
|
+
if (node.kind === 354 /* SyntaxList */ && node._children.length > 0) {
|
|
11020
11027
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
11021
11028
|
}
|
|
11022
11029
|
return skipTrivia(
|
|
@@ -11355,7 +11362,7 @@ function tryGetTextOfPropertyName(name) {
|
|
|
11355
11362
|
switch (name.kind) {
|
|
11356
11363
|
case 79 /* Identifier */:
|
|
11357
11364
|
case 80 /* PrivateIdentifier */:
|
|
11358
|
-
return name.
|
|
11365
|
+
return name.autoGenerate ? void 0 : name.escapedText;
|
|
11359
11366
|
case 10 /* StringLiteral */:
|
|
11360
11367
|
case 8 /* NumericLiteral */:
|
|
11361
11368
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
@@ -13178,7 +13185,7 @@ function getOperator(expression) {
|
|
|
13178
13185
|
}
|
|
13179
13186
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
13180
13187
|
switch (nodeKind) {
|
|
13181
|
-
case
|
|
13188
|
+
case 357 /* CommaListExpression */:
|
|
13182
13189
|
return 0 /* Comma */;
|
|
13183
13190
|
case 227 /* SpreadElement */:
|
|
13184
13191
|
return 1 /* Spread */;
|
|
@@ -14412,7 +14419,7 @@ function closeFileWatcher(watcher) {
|
|
|
14412
14419
|
watcher.close();
|
|
14413
14420
|
}
|
|
14414
14421
|
function getCheckFlags(symbol) {
|
|
14415
|
-
return symbol.flags & 33554432 /* Transient */ ? symbol.checkFlags : 0;
|
|
14422
|
+
return symbol.flags & 33554432 /* Transient */ ? symbol.links.checkFlags : 0;
|
|
14416
14423
|
}
|
|
14417
14424
|
function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
14418
14425
|
if (s.valueDeclaration) {
|
|
@@ -14421,7 +14428,7 @@ function getDeclarationModifierFlagsFromSymbol(s, isWrite = false) {
|
|
|
14421
14428
|
return s.parent && s.parent.flags & 32 /* Class */ ? flags : flags & ~28 /* AccessibilityModifier */;
|
|
14422
14429
|
}
|
|
14423
14430
|
if (getCheckFlags(s) & 6 /* Synthetic */) {
|
|
14424
|
-
const checkFlags = s.checkFlags;
|
|
14431
|
+
const checkFlags = s.links.checkFlags;
|
|
14425
14432
|
const accessModifier = checkFlags & 1024 /* ContainsPrivate */ ? 8 /* Private */ : checkFlags & 256 /* ContainsPublic */ ? 4 /* Public */ : 16 /* Protected */;
|
|
14426
14433
|
const staticModifier = checkFlags & 2048 /* ContainsStatic */ ? 32 /* Static */ : 0;
|
|
14427
14434
|
return accessModifier | staticModifier;
|
|
@@ -14607,7 +14614,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
14607
14614
|
case 209 /* ElementAccessExpression */:
|
|
14608
14615
|
case 208 /* PropertyAccessExpression */:
|
|
14609
14616
|
case 232 /* NonNullExpression */:
|
|
14610
|
-
case
|
|
14617
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
14611
14618
|
case 235 /* SatisfiesExpression */:
|
|
14612
14619
|
node = node.expression;
|
|
14613
14620
|
continue;
|
|
@@ -14620,9 +14627,16 @@ function Symbol4(flags, name) {
|
|
|
14620
14627
|
this.escapedName = name;
|
|
14621
14628
|
this.declarations = void 0;
|
|
14622
14629
|
this.valueDeclaration = void 0;
|
|
14623
|
-
this.id =
|
|
14624
|
-
this.mergeId =
|
|
14630
|
+
this.id = 0;
|
|
14631
|
+
this.mergeId = 0;
|
|
14625
14632
|
this.parent = void 0;
|
|
14633
|
+
this.members = void 0;
|
|
14634
|
+
this.exports = void 0;
|
|
14635
|
+
this.exportSymbol = void 0;
|
|
14636
|
+
this.constEnumOnlyModule = void 0;
|
|
14637
|
+
this.isReferenced = void 0;
|
|
14638
|
+
this.isAssigned = void 0;
|
|
14639
|
+
this.links = void 0;
|
|
14626
14640
|
}
|
|
14627
14641
|
function Type3(checker, flags) {
|
|
14628
14642
|
this.flags = flags;
|
|
@@ -14928,7 +14942,7 @@ function getEmitModuleResolutionKind(compilerOptions) {
|
|
|
14928
14942
|
if (moduleResolution === void 0) {
|
|
14929
14943
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
14930
14944
|
case 1 /* CommonJS */:
|
|
14931
|
-
moduleResolution = 2 /*
|
|
14945
|
+
moduleResolution = 2 /* Node10 */;
|
|
14932
14946
|
break;
|
|
14933
14947
|
case 100 /* Node16 */:
|
|
14934
14948
|
moduleResolution = 3 /* Node16 */;
|
|
@@ -15803,7 +15817,7 @@ function getContainingNodeArray(node) {
|
|
|
15803
15817
|
return parent.types;
|
|
15804
15818
|
case 186 /* TupleType */:
|
|
15805
15819
|
case 206 /* ArrayLiteralExpression */:
|
|
15806
|
-
case
|
|
15820
|
+
case 357 /* CommaListExpression */:
|
|
15807
15821
|
case 272 /* NamedImports */:
|
|
15808
15822
|
case 276 /* NamedExports */:
|
|
15809
15823
|
return parent.elements;
|
|
@@ -15972,6 +15986,15 @@ function isOptionalDeclaration(declaration) {
|
|
|
15972
15986
|
return false;
|
|
15973
15987
|
}
|
|
15974
15988
|
}
|
|
15989
|
+
function isJSDocSatisfiesExpression(node) {
|
|
15990
|
+
return isInJSFile(node) && isParenthesizedExpression(node) && !!getJSDocSatisfiesTag(node);
|
|
15991
|
+
}
|
|
15992
|
+
function getJSDocSatisfiesExpressionType(node) {
|
|
15993
|
+
const tag = getJSDocSatisfiesTag(node);
|
|
15994
|
+
const type = tag && tag.typeExpression && tag.typeExpression.type;
|
|
15995
|
+
Debug.assertIsDefined(type);
|
|
15996
|
+
return type;
|
|
15997
|
+
}
|
|
15975
15998
|
|
|
15976
15999
|
// src/compiler/factory/baseNodeFactory.ts
|
|
15977
16000
|
function createBaseNodeFactory() {
|
|
@@ -16918,6 +16941,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
16918
16941
|
get updateJSDocThrowsTag() {
|
|
16919
16942
|
return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */);
|
|
16920
16943
|
},
|
|
16944
|
+
get createJSDocSatisfiesTag() {
|
|
16945
|
+
return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */);
|
|
16946
|
+
},
|
|
16947
|
+
get updateJSDocSatisfiesTag() {
|
|
16948
|
+
return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */);
|
|
16949
|
+
},
|
|
16921
16950
|
createJSDocEnumTag,
|
|
16922
16951
|
updateJSDocEnumTag,
|
|
16923
16952
|
createJSDocUnknownTag,
|
|
@@ -17225,15 +17254,23 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
17225
17254
|
const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
|
|
17226
17255
|
node.originalKeywordKind = originalKeywordKind;
|
|
17227
17256
|
node.escapedText = escapedText;
|
|
17228
|
-
node.
|
|
17257
|
+
node.autoGenerate = void 0;
|
|
17258
|
+
node.typeArguments = void 0;
|
|
17259
|
+
node.hasExtendedUnicodeEscape = void 0;
|
|
17260
|
+
node.jsDoc = void 0;
|
|
17261
|
+
node.jsDocCache = void 0;
|
|
17262
|
+
node.flowNode = void 0;
|
|
17263
|
+
node.symbol = void 0;
|
|
17229
17264
|
return node;
|
|
17230
17265
|
}
|
|
17231
17266
|
function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
17232
17267
|
const node = createBaseIdentifier(escapeLeadingUnderscores(text), void 0);
|
|
17233
|
-
node.
|
|
17234
|
-
|
|
17235
|
-
|
|
17236
|
-
|
|
17268
|
+
node.autoGenerate = {
|
|
17269
|
+
flags: autoGenerateFlags,
|
|
17270
|
+
id: nextAutoGenerateId,
|
|
17271
|
+
prefix,
|
|
17272
|
+
suffix
|
|
17273
|
+
};
|
|
17237
17274
|
nextAutoGenerateId++;
|
|
17238
17275
|
return node;
|
|
17239
17276
|
}
|
|
@@ -17247,10 +17284,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
17247
17284
|
const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind);
|
|
17248
17285
|
node.typeArguments = asNodeArray(typeArguments);
|
|
17249
17286
|
node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
|
|
17250
|
-
node.jsDoc = void 0;
|
|
17251
|
-
node.jsDocCache = void 0;
|
|
17252
|
-
node.flowNode = void 0;
|
|
17253
|
-
node.symbol = void 0;
|
|
17254
17287
|
if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
|
|
17255
17288
|
node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
|
|
17256
17289
|
}
|
|
@@ -17295,7 +17328,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
17295
17328
|
function createBasePrivateIdentifier(escapedText) {
|
|
17296
17329
|
const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
|
|
17297
17330
|
node.escapedText = escapedText;
|
|
17298
|
-
node.
|
|
17331
|
+
node.autoGenerate = void 0;
|
|
17299
17332
|
node.transformFlags |= 16777216 /* ContainsClassFields */;
|
|
17300
17333
|
return node;
|
|
17301
17334
|
}
|
|
@@ -17306,10 +17339,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
17306
17339
|
}
|
|
17307
17340
|
function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
|
|
17308
17341
|
const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
|
|
17309
|
-
node.
|
|
17310
|
-
|
|
17311
|
-
|
|
17312
|
-
|
|
17342
|
+
node.autoGenerate = {
|
|
17343
|
+
flags: autoGenerateFlags,
|
|
17344
|
+
id: nextAutoGenerateId,
|
|
17345
|
+
prefix,
|
|
17346
|
+
suffix
|
|
17347
|
+
};
|
|
17313
17348
|
nextAutoGenerateId++;
|
|
17314
17349
|
return node;
|
|
17315
17350
|
}
|
|
@@ -20036,18 +20071,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20036
20071
|
return node;
|
|
20037
20072
|
}
|
|
20038
20073
|
function createSyntaxList(children) {
|
|
20039
|
-
const node = createBaseNode(
|
|
20074
|
+
const node = createBaseNode(354 /* SyntaxList */);
|
|
20040
20075
|
node._children = children;
|
|
20041
20076
|
return node;
|
|
20042
20077
|
}
|
|
20043
20078
|
function createNotEmittedStatement(original) {
|
|
20044
|
-
const node = createBaseNode(
|
|
20079
|
+
const node = createBaseNode(355 /* NotEmittedStatement */);
|
|
20045
20080
|
node.original = original;
|
|
20046
20081
|
setTextRange(node, original);
|
|
20047
20082
|
return node;
|
|
20048
20083
|
}
|
|
20049
20084
|
function createPartiallyEmittedExpression(expression, original) {
|
|
20050
|
-
const node = createBaseNode(
|
|
20085
|
+
const node = createBaseNode(356 /* PartiallyEmittedExpression */);
|
|
20051
20086
|
node.expression = expression;
|
|
20052
20087
|
node.original = original;
|
|
20053
20088
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -20069,7 +20104,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20069
20104
|
return node;
|
|
20070
20105
|
}
|
|
20071
20106
|
function createCommaListExpression(elements) {
|
|
20072
|
-
const node = createBaseNode(
|
|
20107
|
+
const node = createBaseNode(357 /* CommaListExpression */);
|
|
20073
20108
|
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
|
|
20074
20109
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
20075
20110
|
return node;
|
|
@@ -20078,19 +20113,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20078
20113
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
20079
20114
|
}
|
|
20080
20115
|
function createEndOfDeclarationMarker(original) {
|
|
20081
|
-
const node = createBaseNode(
|
|
20116
|
+
const node = createBaseNode(359 /* EndOfDeclarationMarker */);
|
|
20082
20117
|
node.emitNode = {};
|
|
20083
20118
|
node.original = original;
|
|
20084
20119
|
return node;
|
|
20085
20120
|
}
|
|
20086
20121
|
function createMergeDeclarationMarker(original) {
|
|
20087
|
-
const node = createBaseNode(
|
|
20122
|
+
const node = createBaseNode(358 /* MergeDeclarationMarker */);
|
|
20088
20123
|
node.emitNode = {};
|
|
20089
20124
|
node.original = original;
|
|
20090
20125
|
return node;
|
|
20091
20126
|
}
|
|
20092
20127
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
20093
|
-
const node = createBaseNode(
|
|
20128
|
+
const node = createBaseNode(360 /* SyntheticReferenceExpression */);
|
|
20094
20129
|
node.expression = expression;
|
|
20095
20130
|
node.thisArg = thisArg;
|
|
20096
20131
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -20102,10 +20137,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20102
20137
|
function cloneGeneratedIdentifier(node) {
|
|
20103
20138
|
const clone2 = createBaseIdentifier(node.escapedText, void 0);
|
|
20104
20139
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
20105
|
-
clone2.
|
|
20106
|
-
clone2.autoGenerateId = node.autoGenerateId;
|
|
20107
|
-
clone2.autoGeneratePrefix = node.autoGeneratePrefix;
|
|
20108
|
-
clone2.autoGenerateSuffix = node.autoGenerateSuffix;
|
|
20140
|
+
clone2.autoGenerate = { ...node.autoGenerate };
|
|
20109
20141
|
clone2.transformFlags = node.transformFlags;
|
|
20110
20142
|
setOriginalNode(clone2, node);
|
|
20111
20143
|
return clone2;
|
|
@@ -20126,10 +20158,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20126
20158
|
function cloneGeneratedPrivateIdentifier(node) {
|
|
20127
20159
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
20128
20160
|
clone2.flags |= node.flags & ~8 /* Synthesized */;
|
|
20129
|
-
clone2.
|
|
20130
|
-
clone2.autoGenerateId = node.autoGenerateId;
|
|
20131
|
-
clone2.autoGeneratePrefix = node.autoGeneratePrefix;
|
|
20132
|
-
clone2.autoGenerateSuffix = node.autoGenerateSuffix;
|
|
20161
|
+
clone2.autoGenerate = { ...node.autoGenerate };
|
|
20133
20162
|
clone2.transformFlags = node.transformFlags;
|
|
20134
20163
|
setOriginalNode(clone2, node);
|
|
20135
20164
|
return clone2;
|
|
@@ -20295,7 +20324,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20295
20324
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
20296
20325
|
case 232 /* NonNullExpression */:
|
|
20297
20326
|
return updateNonNullExpression(outerExpression, expression);
|
|
20298
|
-
case
|
|
20327
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
20299
20328
|
return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
20300
20329
|
}
|
|
20301
20330
|
}
|
|
@@ -20805,7 +20834,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
20805
20834
|
case 213 /* TypeAssertionExpression */:
|
|
20806
20835
|
case 235 /* SatisfiesExpression */:
|
|
20807
20836
|
case 231 /* AsExpression */:
|
|
20808
|
-
case
|
|
20837
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
20809
20838
|
case 214 /* ParenthesizedExpression */:
|
|
20810
20839
|
case 106 /* SuperKeyword */:
|
|
20811
20840
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -22257,10 +22286,10 @@ function isMetaProperty(node) {
|
|
|
22257
22286
|
return node.kind === 233 /* MetaProperty */;
|
|
22258
22287
|
}
|
|
22259
22288
|
function isPartiallyEmittedExpression(node) {
|
|
22260
|
-
return node.kind ===
|
|
22289
|
+
return node.kind === 356 /* PartiallyEmittedExpression */;
|
|
22261
22290
|
}
|
|
22262
22291
|
function isCommaListExpression(node) {
|
|
22263
|
-
return node.kind ===
|
|
22292
|
+
return node.kind === 357 /* CommaListExpression */;
|
|
22264
22293
|
}
|
|
22265
22294
|
function isTemplateSpan(node) {
|
|
22266
22295
|
return node.kind === 236 /* TemplateSpan */;
|
|
@@ -22383,10 +22412,10 @@ function isExportSpecifier(node) {
|
|
|
22383
22412
|
return node.kind === 278 /* ExportSpecifier */;
|
|
22384
22413
|
}
|
|
22385
22414
|
function isNotEmittedStatement(node) {
|
|
22386
|
-
return node.kind ===
|
|
22415
|
+
return node.kind === 355 /* NotEmittedStatement */;
|
|
22387
22416
|
}
|
|
22388
22417
|
function isSyntheticReference(node) {
|
|
22389
|
-
return node.kind ===
|
|
22418
|
+
return node.kind === 360 /* SyntheticReferenceExpression */;
|
|
22390
22419
|
}
|
|
22391
22420
|
function isExternalModuleReference(node) {
|
|
22392
22421
|
return node.kind === 280 /* ExternalModuleReference */;
|
|
@@ -22553,6 +22582,9 @@ function isJSDocPropertyTag(node) {
|
|
|
22553
22582
|
function isJSDocImplementsTag(node) {
|
|
22554
22583
|
return node.kind === 332 /* JSDocImplementsTag */;
|
|
22555
22584
|
}
|
|
22585
|
+
function isJSDocSatisfiesTag(node) {
|
|
22586
|
+
return node.kind === 353 /* JSDocSatisfiesTag */;
|
|
22587
|
+
}
|
|
22556
22588
|
|
|
22557
22589
|
// src/compiler/factory/utilities.ts
|
|
22558
22590
|
function createEmptyExports(factory2) {
|
|
@@ -22848,7 +22880,7 @@ function startsWithUseStrict(statements) {
|
|
|
22848
22880
|
return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
|
|
22849
22881
|
}
|
|
22850
22882
|
function isCommaSequence(node) {
|
|
22851
|
-
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind ===
|
|
22883
|
+
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 357 /* CommaListExpression */;
|
|
22852
22884
|
}
|
|
22853
22885
|
function isJSDocTypeAssertion(node) {
|
|
22854
22886
|
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
|
|
@@ -22871,7 +22903,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
22871
22903
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
22872
22904
|
case 232 /* NonNullExpression */:
|
|
22873
22905
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
22874
|
-
case
|
|
22906
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
22875
22907
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
22876
22908
|
}
|
|
22877
22909
|
return false;
|
|
@@ -23328,13 +23360,13 @@ function elideNodes(factory2, nodes) {
|
|
|
23328
23360
|
return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes);
|
|
23329
23361
|
}
|
|
23330
23362
|
function getNodeForGeneratedName(name) {
|
|
23331
|
-
if (name.
|
|
23332
|
-
const autoGenerateId = name.
|
|
23363
|
+
if (name.autoGenerate.flags & 4 /* Node */) {
|
|
23364
|
+
const autoGenerateId = name.autoGenerate.id;
|
|
23333
23365
|
let node = name;
|
|
23334
23366
|
let original = node.original;
|
|
23335
23367
|
while (original) {
|
|
23336
23368
|
node = original;
|
|
23337
|
-
if (isMemberName(node) && !!(node.
|
|
23369
|
+
if (isMemberName(node) && (node.autoGenerate === void 0 || !!(node.autoGenerate.flags & 4 /* Node */) && node.autoGenerate.id !== autoGenerateId)) {
|
|
23338
23370
|
break;
|
|
23339
23371
|
}
|
|
23340
23372
|
original = node.original;
|
|
@@ -23798,7 +23830,7 @@ var forEachChildTable = {
|
|
|
23798
23830
|
[279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
23799
23831
|
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
|
|
23800
23832
|
},
|
|
23801
|
-
[
|
|
23833
|
+
[357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
23802
23834
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
23803
23835
|
},
|
|
23804
23836
|
[281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -23870,6 +23902,7 @@ var forEachChildTable = {
|
|
|
23870
23902
|
[347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag,
|
|
23871
23903
|
[346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag,
|
|
23872
23904
|
[343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag,
|
|
23905
|
+
[353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag,
|
|
23873
23906
|
[352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag,
|
|
23874
23907
|
[326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
|
|
23875
23908
|
return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
|
|
@@ -23888,7 +23921,7 @@ var forEachChildTable = {
|
|
|
23888
23921
|
[339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
23889
23922
|
[334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
23890
23923
|
[340 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
23891
|
-
[
|
|
23924
|
+
[356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
23892
23925
|
};
|
|
23893
23926
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
23894
23927
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -29212,6 +29245,9 @@ var Parser;
|
|
|
29212
29245
|
case "overload":
|
|
29213
29246
|
tag = parseOverloadTag(start2, tagName, margin, indentText);
|
|
29214
29247
|
break;
|
|
29248
|
+
case "satisfies":
|
|
29249
|
+
tag = parseSatisfiesTag(start2, tagName, margin, indentText);
|
|
29250
|
+
break;
|
|
29215
29251
|
case "see":
|
|
29216
29252
|
tag = parseSeeTag(start2, tagName, margin, indentText);
|
|
29217
29253
|
break;
|
|
@@ -29514,6 +29550,14 @@ var Parser;
|
|
|
29514
29550
|
const className = parseExpressionWithTypeArgumentsForAugments();
|
|
29515
29551
|
return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2);
|
|
29516
29552
|
}
|
|
29553
|
+
function parseSatisfiesTag(start2, tagName, margin, indentText) {
|
|
29554
|
+
if (some(tags, isJSDocSatisfiesTag)) {
|
|
29555
|
+
parseErrorAt(tagName.pos, scanner.getTokenPos(), Diagnostics._0_tag_already_specified, tagName.escapedText);
|
|
29556
|
+
}
|
|
29557
|
+
const typeExpression = parseJSDocTypeExpression(true);
|
|
29558
|
+
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
|
|
29559
|
+
return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
|
|
29560
|
+
}
|
|
29517
29561
|
function parseExpressionWithTypeArgumentsForAugments() {
|
|
29518
29562
|
const usedBrace = parseOptional(18 /* OpenBraceToken */);
|
|
29519
29563
|
const pos = getNodePos();
|
|
@@ -31133,12 +31177,14 @@ var commandOptionsWithoutBuild = [
|
|
|
31133
31177
|
{
|
|
31134
31178
|
name: "moduleResolution",
|
|
31135
31179
|
type: new Map(getEntries({
|
|
31136
|
-
|
|
31180
|
+
node10: 2 /* Node10 */,
|
|
31181
|
+
node: 2 /* Node10 */,
|
|
31137
31182
|
classic: 1 /* Classic */,
|
|
31138
31183
|
node16: 3 /* Node16 */,
|
|
31139
31184
|
nodenext: 99 /* NodeNext */,
|
|
31140
31185
|
bundler: 100 /* Bundler */
|
|
31141
31186
|
})),
|
|
31187
|
+
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
31142
31188
|
affectsModuleResolution: true,
|
|
31143
31189
|
paramType: Diagnostics.STRATEGY,
|
|
31144
31190
|
category: Diagnostics.Modules,
|
|
@@ -31658,6 +31704,11 @@ var commandOptionsWithoutBuild = [
|
|
|
31658
31704
|
description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
31659
31705
|
category: Diagnostics.Language_and_Environment,
|
|
31660
31706
|
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
|
|
31707
|
+
},
|
|
31708
|
+
{
|
|
31709
|
+
name: "ignoreDeprecations",
|
|
31710
|
+
type: "string",
|
|
31711
|
+
defaultValueDescription: void 0
|
|
31661
31712
|
}
|
|
31662
31713
|
];
|
|
31663
31714
|
var optionDeclarations = [
|
|
@@ -31782,8 +31833,9 @@ function createCompilerDiagnosticForInvalidCustomType(opt) {
|
|
|
31782
31833
|
return createDiagnosticForInvalidCustomType(opt, createCompilerDiagnostic);
|
|
31783
31834
|
}
|
|
31784
31835
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
31785
|
-
const namesOfType = arrayFrom(opt.type.keys())
|
|
31786
|
-
|
|
31836
|
+
const namesOfType = arrayFrom(opt.type.keys());
|
|
31837
|
+
const stringNames = (opt.deprecatedKeys ? namesOfType.filter((k) => !opt.deprecatedKeys.has(k)) : namesOfType).map((key) => `'${key}'`).join(", ");
|
|
31838
|
+
return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
|
|
31787
31839
|
}
|
|
31788
31840
|
function parseCustomTypeOption(opt, value, errors) {
|
|
31789
31841
|
return convertJsonOptionOfCustomType(opt, trimString(value || ""), errors);
|
|
@@ -33009,7 +33061,7 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag
|
|
|
33009
33061
|
}
|
|
33010
33062
|
return extendedConfigPath;
|
|
33011
33063
|
}
|
|
33012
|
-
const resolved = nodeModuleNameResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), { moduleResolution: 2 /*
|
|
33064
|
+
const resolved = nodeModuleNameResolver(extendedConfig, combinePaths(basePath, "tsconfig.json"), { moduleResolution: 2 /* Node10 */ }, host, void 0, void 0, true);
|
|
33013
33065
|
if (resolved.resolvedModule) {
|
|
33014
33066
|
return resolved.resolvedModule.resolvedFileName;
|
|
33015
33067
|
}
|
|
@@ -34145,7 +34197,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
34145
34197
|
if (moduleResolution === void 0) {
|
|
34146
34198
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
34147
34199
|
case 1 /* CommonJS */:
|
|
34148
|
-
moduleResolution = 2 /*
|
|
34200
|
+
moduleResolution = 2 /* Node10 */;
|
|
34149
34201
|
break;
|
|
34150
34202
|
case 100 /* Node16 */:
|
|
34151
34203
|
moduleResolution = 3 /* Node16 */;
|
|
@@ -34173,7 +34225,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
34173
34225
|
case 99 /* NodeNext */:
|
|
34174
34226
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
34175
34227
|
break;
|
|
34176
|
-
case 2 /*
|
|
34228
|
+
case 2 /* Node10 */:
|
|
34177
34229
|
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
34178
34230
|
break;
|
|
34179
34231
|
case 1 /* Classic */:
|
|
@@ -34362,7 +34414,7 @@ function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
|
34362
34414
|
0 /* None */,
|
|
34363
34415
|
moduleName,
|
|
34364
34416
|
initialDir,
|
|
34365
|
-
{ moduleResolution: 2 /*
|
|
34417
|
+
{ moduleResolution: 2 /* Node10 */, allowJs: true },
|
|
34366
34418
|
host,
|
|
34367
34419
|
void 0,
|
|
34368
34420
|
2 /* JavaScript */,
|
|
@@ -34415,7 +34467,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
34415
34467
|
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
34416
34468
|
}
|
|
34417
34469
|
let result;
|
|
34418
|
-
if (getEmitModuleResolutionKind(compilerOptions) === 2 /*
|
|
34470
|
+
if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) {
|
|
34419
34471
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
34420
34472
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
34421
34473
|
result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
|
|
@@ -38991,8 +39043,8 @@ var intrinsicTypeKinds = new Map(getEntries({
|
|
|
38991
39043
|
Capitalize: 2 /* Capitalize */,
|
|
38992
39044
|
Uncapitalize: 3 /* Uncapitalize */
|
|
38993
39045
|
}));
|
|
38994
|
-
|
|
38995
|
-
}
|
|
39046
|
+
var SymbolLinks = class {
|
|
39047
|
+
};
|
|
38996
39048
|
function NodeLinks() {
|
|
38997
39049
|
this.flags = 0 /* None */;
|
|
38998
39050
|
}
|
|
@@ -39847,7 +39899,8 @@ function createTypeChecker(host) {
|
|
|
39847
39899
|
function createSymbol(flags, name, checkFlags) {
|
|
39848
39900
|
symbolCount++;
|
|
39849
39901
|
const symbol = new Symbol12(flags | 33554432 /* Transient */, name);
|
|
39850
|
-
symbol.
|
|
39902
|
+
symbol.links = new SymbolLinks();
|
|
39903
|
+
symbol.links.checkFlags = checkFlags || 0 /* None */;
|
|
39851
39904
|
return symbol;
|
|
39852
39905
|
}
|
|
39853
39906
|
function getExcludedSymbolFlags(flags) {
|
|
@@ -40072,10 +40125,11 @@ function createTypeChecker(host) {
|
|
|
40072
40125
|
}
|
|
40073
40126
|
}
|
|
40074
40127
|
function getSymbolLinks(symbol) {
|
|
40128
|
+
var _a2;
|
|
40075
40129
|
if (symbol.flags & 33554432 /* Transient */)
|
|
40076
|
-
return symbol;
|
|
40130
|
+
return symbol.links;
|
|
40077
40131
|
const id = getSymbolId(symbol);
|
|
40078
|
-
return symbolLinks[id]
|
|
40132
|
+
return (_a2 = symbolLinks[id]) != null ? _a2 : symbolLinks[id] = new SymbolLinks();
|
|
40079
40133
|
}
|
|
40080
40134
|
function getNodeLinks(node) {
|
|
40081
40135
|
const nodeId = getNodeId(node);
|
|
@@ -41609,7 +41663,7 @@ function createTypeChecker(host) {
|
|
|
41609
41663
|
}
|
|
41610
41664
|
function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) {
|
|
41611
41665
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
41612
|
-
const errorMessage = isClassic ? Diagnostics.
|
|
41666
|
+
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;
|
|
41613
41667
|
return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage);
|
|
41614
41668
|
}
|
|
41615
41669
|
function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation = false) {
|
|
@@ -41875,8 +41929,8 @@ function createTypeChecker(host) {
|
|
|
41875
41929
|
const result = createSymbol(symbol.flags, symbol.escapedName);
|
|
41876
41930
|
result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
|
|
41877
41931
|
result.parent = symbol.parent;
|
|
41878
|
-
result.target = symbol;
|
|
41879
|
-
result.originatingImport = referenceParent;
|
|
41932
|
+
result.links.target = symbol;
|
|
41933
|
+
result.links.originatingImport = referenceParent;
|
|
41880
41934
|
if (symbol.valueDeclaration)
|
|
41881
41935
|
result.valueDeclaration = symbol.valueDeclaration;
|
|
41882
41936
|
if (symbol.constEnumOnlyModule)
|
|
@@ -41886,7 +41940,7 @@ function createTypeChecker(host) {
|
|
|
41886
41940
|
if (symbol.exports)
|
|
41887
41941
|
result.exports = new Map(symbol.exports);
|
|
41888
41942
|
const resolvedModuleType = resolveStructuredTypeMembers(moduleType);
|
|
41889
|
-
result.type = createAnonymousType(result, resolvedModuleType.members, emptyArray, emptyArray, resolvedModuleType.indexInfos);
|
|
41943
|
+
result.links.type = createAnonymousType(result, resolvedModuleType.members, emptyArray, emptyArray, resolvedModuleType.indexInfos);
|
|
41890
41944
|
return result;
|
|
41891
41945
|
}
|
|
41892
41946
|
function hasExportAssignmentSymbol(moduleSymbol) {
|
|
@@ -43341,7 +43395,7 @@ function createTypeChecker(host) {
|
|
|
43341
43395
|
}
|
|
43342
43396
|
function shouldUsePlaceholderForProperty(propertySymbol, context) {
|
|
43343
43397
|
var _a2;
|
|
43344
|
-
return !!(getCheckFlags(propertySymbol) & 8192 /* ReverseMapped */) && (contains(context.reverseMappedStack, propertySymbol) || ((_a2 = context.reverseMappedStack) == null ? void 0 : _a2[0]) && !(getObjectFlags(last(context.reverseMappedStack).propertyType) & 16 /* Anonymous */));
|
|
43398
|
+
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 */));
|
|
43345
43399
|
}
|
|
43346
43400
|
function addPropertyToElementList(propertySymbol, context, typeElements) {
|
|
43347
43401
|
var _a2;
|
|
@@ -43717,7 +43771,7 @@ function createTypeChecker(host) {
|
|
|
43717
43771
|
const params = getTypeParametersOfClassOrInterface(
|
|
43718
43772
|
parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol
|
|
43719
43773
|
);
|
|
43720
|
-
typeParameterNodes = mapToTypeNodes(map(params, (t) => getMappedType(t, nextSymbol.mapper)), context);
|
|
43774
|
+
typeParameterNodes = mapToTypeNodes(map(params, (t) => getMappedType(t, nextSymbol.links.mapper)), context);
|
|
43721
43775
|
} else {
|
|
43722
43776
|
typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context);
|
|
43723
43777
|
}
|
|
@@ -46194,7 +46248,7 @@ function createTypeChecker(host) {
|
|
|
46194
46248
|
);
|
|
46195
46249
|
}
|
|
46196
46250
|
const union = createSymbol(s.flags | exportedMember.flags, name);
|
|
46197
|
-
union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
|
|
46251
|
+
union.links.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
|
|
46198
46252
|
union.valueDeclaration = exportedMember.valueDeclaration;
|
|
46199
46253
|
union.declarations = concatenate(exportedMember.declarations, s.declarations);
|
|
46200
46254
|
members.set(name, union);
|
|
@@ -46281,8 +46335,8 @@ function createTypeChecker(host) {
|
|
|
46281
46335
|
const text = getPropertyNameFromType(exprType);
|
|
46282
46336
|
const flags = 4 /* Property */ | (e.initializer ? 16777216 /* Optional */ : 0);
|
|
46283
46337
|
const symbol = createSymbol(flags, text);
|
|
46284
|
-
symbol.type = getTypeFromBindingElement(e, includePatternInType, reportErrors2);
|
|
46285
|
-
symbol.bindingElement = e;
|
|
46338
|
+
symbol.links.type = getTypeFromBindingElement(e, includePatternInType, reportErrors2);
|
|
46339
|
+
symbol.links.bindingElement = e;
|
|
46286
46340
|
members.set(symbol.escapedName, symbol);
|
|
46287
46341
|
});
|
|
46288
46342
|
const result = createAnonymousType(void 0, members, emptyArray, emptyArray, stringIndexInfo ? [stringIndexInfo] : emptyArray);
|
|
@@ -46390,7 +46444,7 @@ function createTypeChecker(host) {
|
|
|
46390
46444
|
const result = createSymbol(fileSymbol.flags, "exports");
|
|
46391
46445
|
result.declarations = fileSymbol.declarations ? fileSymbol.declarations.slice() : [];
|
|
46392
46446
|
result.parent = symbol;
|
|
46393
|
-
result.target = fileSymbol;
|
|
46447
|
+
result.links.target = fileSymbol;
|
|
46394
46448
|
if (fileSymbol.valueDeclaration)
|
|
46395
46449
|
result.valueDeclaration = fileSymbol.valueDeclaration;
|
|
46396
46450
|
if (fileSymbol.members)
|
|
@@ -46556,7 +46610,8 @@ function createTypeChecker(host) {
|
|
|
46556
46610
|
if (expando) {
|
|
46557
46611
|
const merged = mergeJSSymbols(symbol, expando);
|
|
46558
46612
|
if (merged) {
|
|
46559
|
-
symbol =
|
|
46613
|
+
symbol = merged;
|
|
46614
|
+
links = merged.links;
|
|
46560
46615
|
}
|
|
46561
46616
|
}
|
|
46562
46617
|
originalLinks.type = links.type = getTypeOfFuncClassEnumModuleWorker(symbol);
|
|
@@ -46653,7 +46708,7 @@ function createTypeChecker(host) {
|
|
|
46653
46708
|
function getWriteTypeOfSymbol(symbol) {
|
|
46654
46709
|
const checkFlags = getCheckFlags(symbol);
|
|
46655
46710
|
if (symbol.flags & 4 /* Property */) {
|
|
46656
|
-
return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.writeType || symbol.type : getTypeOfSymbol(symbol);
|
|
46711
|
+
return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.links.writeType || symbol.links.type : getTypeOfSymbol(symbol);
|
|
46657
46712
|
}
|
|
46658
46713
|
if (symbol.flags & 98304 /* Accessor */) {
|
|
46659
46714
|
return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
|
|
@@ -47055,7 +47110,8 @@ function createTypeChecker(host) {
|
|
|
47055
47110
|
const kind = symbol.flags & 32 /* Class */ ? 1 /* Class */ : 2 /* Interface */;
|
|
47056
47111
|
const merged = mergeJSSymbols(symbol, symbol.valueDeclaration && getAssignedClassSymbol(symbol.valueDeclaration));
|
|
47057
47112
|
if (merged) {
|
|
47058
|
-
symbol =
|
|
47113
|
+
symbol = merged;
|
|
47114
|
+
links = merged.links;
|
|
47059
47115
|
}
|
|
47060
47116
|
const type = originalLinks.declaredType = links.declaredType = createObjectType(kind, symbol);
|
|
47061
47117
|
const outerTypeParameters = getOuterTypeParametersOfClassOrInterface(symbol);
|
|
@@ -47331,7 +47387,7 @@ function createTypeChecker(host) {
|
|
|
47331
47387
|
error(declName || decl, Diagnostics.Duplicate_property_0, name);
|
|
47332
47388
|
lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */);
|
|
47333
47389
|
}
|
|
47334
|
-
lateSymbol.nameType = type;
|
|
47390
|
+
lateSymbol.links.nameType = type;
|
|
47335
47391
|
addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags);
|
|
47336
47392
|
if (lateSymbol.parent) {
|
|
47337
47393
|
Debug.assert(lateSymbol.parent === parent, "Existing symbol parent should match new one");
|
|
@@ -47537,7 +47593,7 @@ function createTypeChecker(host) {
|
|
|
47537
47593
|
const flags = restType.target.elementFlags[i];
|
|
47538
47594
|
const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
|
|
47539
47595
|
const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
|
|
47540
|
-
symbol.type = flags & 4 /* Rest */ ? createArrayType(t) : t;
|
|
47596
|
+
symbol.links.type = flags & 4 /* Rest */ ? createArrayType(t) : t;
|
|
47541
47597
|
return symbol;
|
|
47542
47598
|
});
|
|
47543
47599
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
@@ -47697,14 +47753,14 @@ function createTypeChecker(host) {
|
|
|
47697
47753
|
1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0),
|
|
47698
47754
|
paramName || `arg${i}`
|
|
47699
47755
|
);
|
|
47700
|
-
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
47756
|
+
paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
47701
47757
|
params[i] = paramSymbol;
|
|
47702
47758
|
}
|
|
47703
47759
|
if (needsExtraRestElement) {
|
|
47704
47760
|
const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args");
|
|
47705
|
-
restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
47761
|
+
restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
47706
47762
|
if (shorter === right) {
|
|
47707
|
-
restParamSymbol.type = instantiateType(restParamSymbol.type, mapper);
|
|
47763
|
+
restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper);
|
|
47708
47764
|
}
|
|
47709
47765
|
params[longestCount] = restParamSymbol;
|
|
47710
47766
|
}
|
|
@@ -47924,16 +47980,16 @@ function createTypeChecker(host) {
|
|
|
47924
47980
|
const checkFlags = 8192 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0);
|
|
47925
47981
|
const inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags);
|
|
47926
47982
|
inferredProp.declarations = prop.declarations;
|
|
47927
|
-
inferredProp.nameType = getSymbolLinks(prop).nameType;
|
|
47928
|
-
inferredProp.propertyType = getTypeOfSymbol(prop);
|
|
47983
|
+
inferredProp.links.nameType = getSymbolLinks(prop).nameType;
|
|
47984
|
+
inferredProp.links.propertyType = getTypeOfSymbol(prop);
|
|
47929
47985
|
if (type.constraintType.type.flags & 8388608 /* IndexedAccess */ && type.constraintType.type.objectType.flags & 262144 /* TypeParameter */ && type.constraintType.type.indexType.flags & 262144 /* TypeParameter */) {
|
|
47930
47986
|
const newTypeParam = type.constraintType.type.objectType;
|
|
47931
47987
|
const newMappedType = replaceIndexedAccess(type.mappedType, type.constraintType.type, newTypeParam);
|
|
47932
|
-
inferredProp.mappedType = newMappedType;
|
|
47933
|
-
inferredProp.constraintType = getIndexType(newTypeParam);
|
|
47988
|
+
inferredProp.links.mappedType = newMappedType;
|
|
47989
|
+
inferredProp.links.constraintType = getIndexType(newTypeParam);
|
|
47934
47990
|
} else {
|
|
47935
|
-
inferredProp.mappedType = type.mappedType;
|
|
47936
|
-
inferredProp.constraintType = type.constraintType;
|
|
47991
|
+
inferredProp.links.mappedType = type.mappedType;
|
|
47992
|
+
inferredProp.links.constraintType = type.constraintType;
|
|
47937
47993
|
}
|
|
47938
47994
|
members.set(prop.escapedName, inferredProp);
|
|
47939
47995
|
}
|
|
@@ -48009,8 +48065,8 @@ function createTypeChecker(host) {
|
|
|
48009
48065
|
const propName = getPropertyNameFromType(propNameType);
|
|
48010
48066
|
const existingProp = members.get(propName);
|
|
48011
48067
|
if (existingProp) {
|
|
48012
|
-
existingProp.nameType = getUnionType([existingProp.nameType, propNameType]);
|
|
48013
|
-
existingProp.keyType = getUnionType([existingProp.keyType, keyType]);
|
|
48068
|
+
existingProp.links.nameType = getUnionType([existingProp.links.nameType, propNameType]);
|
|
48069
|
+
existingProp.links.keyType = getUnionType([existingProp.links.keyType, keyType]);
|
|
48014
48070
|
} else {
|
|
48015
48071
|
const modifiersProp = isTypeUsableAsPropertyName(keyType) ? getPropertyOfType(modifiersType, getPropertyNameFromType(keyType)) : void 0;
|
|
48016
48072
|
const isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */);
|
|
@@ -48022,11 +48078,11 @@ function createTypeChecker(host) {
|
|
|
48022
48078
|
propName,
|
|
48023
48079
|
lateFlag | 262144 /* Mapped */ | (isReadonly ? 8 /* Readonly */ : 0) | (stripOptional ? 524288 /* StripOptional */ : 0)
|
|
48024
48080
|
);
|
|
48025
|
-
prop.mappedType = type;
|
|
48026
|
-
prop.nameType = propNameType;
|
|
48027
|
-
prop.keyType = keyType;
|
|
48081
|
+
prop.links.mappedType = type;
|
|
48082
|
+
prop.links.nameType = propNameType;
|
|
48083
|
+
prop.links.keyType = keyType;
|
|
48028
48084
|
if (modifiersProp) {
|
|
48029
|
-
prop.syntheticOrigin = modifiersProp;
|
|
48085
|
+
prop.links.syntheticOrigin = modifiersProp;
|
|
48030
48086
|
prop.declarations = nameType ? void 0 : modifiersProp.declarations;
|
|
48031
48087
|
}
|
|
48032
48088
|
members.set(propName, prop);
|
|
@@ -48040,23 +48096,23 @@ function createTypeChecker(host) {
|
|
|
48040
48096
|
}
|
|
48041
48097
|
}
|
|
48042
48098
|
function getTypeOfMappedSymbol(symbol) {
|
|
48043
|
-
if (!symbol.type) {
|
|
48044
|
-
const mappedType = symbol.mappedType;
|
|
48099
|
+
if (!symbol.links.type) {
|
|
48100
|
+
const mappedType = symbol.links.mappedType;
|
|
48045
48101
|
if (!pushTypeResolution(symbol, 0 /* Type */)) {
|
|
48046
48102
|
mappedType.containsError = true;
|
|
48047
48103
|
return errorType;
|
|
48048
48104
|
}
|
|
48049
48105
|
const templateType = getTemplateTypeFromMappedType(mappedType.target || mappedType);
|
|
48050
|
-
const mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.keyType);
|
|
48106
|
+
const mapper = appendTypeMapping(mappedType.mapper, getTypeParameterFromMappedType(mappedType), symbol.links.keyType);
|
|
48051
48107
|
const propType = instantiateType(templateType, mapper);
|
|
48052
|
-
let type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType, true) : symbol.checkFlags & 524288 /* StripOptional */ ? removeMissingOrUndefinedType(propType) : propType;
|
|
48108
|
+
let type = strictNullChecks && symbol.flags & 16777216 /* Optional */ && !maybeTypeOfKind(propType, 32768 /* Undefined */ | 16384 /* Void */) ? getOptionalType(propType, true) : symbol.links.checkFlags & 524288 /* StripOptional */ ? removeMissingOrUndefinedType(propType) : propType;
|
|
48053
48109
|
if (!popTypeResolution()) {
|
|
48054
48110
|
error(currentNode, Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1, symbolToString(symbol), typeToString(mappedType));
|
|
48055
48111
|
type = errorType;
|
|
48056
48112
|
}
|
|
48057
|
-
symbol.type = type;
|
|
48113
|
+
symbol.links.type = type;
|
|
48058
48114
|
}
|
|
48059
|
-
return symbol.type;
|
|
48115
|
+
return symbol.links.type;
|
|
48060
48116
|
}
|
|
48061
48117
|
function getTypeParameterFromMappedType(type) {
|
|
48062
48118
|
return type.typeParameter || (type.typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(type.declaration.typeParameter)));
|
|
@@ -48471,7 +48527,7 @@ function createTypeChecker(host) {
|
|
|
48471
48527
|
return getReducedType(getApparentType(getReducedType(type)));
|
|
48472
48528
|
}
|
|
48473
48529
|
function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) {
|
|
48474
|
-
var _a2, _b;
|
|
48530
|
+
var _a2, _b, _c;
|
|
48475
48531
|
let singleProp;
|
|
48476
48532
|
let propSet;
|
|
48477
48533
|
let indexTypes;
|
|
@@ -48539,10 +48595,11 @@ function createTypeChecker(host) {
|
|
|
48539
48595
|
}
|
|
48540
48596
|
if (!propSet && !(checkFlags & 16 /* ReadPartial */) && !indexTypes) {
|
|
48541
48597
|
if (mergedInstantiations) {
|
|
48542
|
-
const
|
|
48543
|
-
clone2
|
|
48544
|
-
clone2.
|
|
48545
|
-
clone2.
|
|
48598
|
+
const links = (_a2 = tryCast(singleProp, isTransientSymbol)) == null ? void 0 : _a2.links;
|
|
48599
|
+
const clone2 = createSymbolWithType(singleProp, links == null ? void 0 : links.type);
|
|
48600
|
+
clone2.parent = (_c = (_b = singleProp.valueDeclaration) == null ? void 0 : _b.symbol) == null ? void 0 : _c.parent;
|
|
48601
|
+
clone2.links.containingType = containingType;
|
|
48602
|
+
clone2.links.mapper = links == null ? void 0 : links.mapper;
|
|
48546
48603
|
return clone2;
|
|
48547
48604
|
} else {
|
|
48548
48605
|
return singleProp;
|
|
@@ -48584,7 +48641,7 @@ function createTypeChecker(host) {
|
|
|
48584
48641
|
}
|
|
48585
48642
|
addRange(propTypes, indexTypes);
|
|
48586
48643
|
const result = createSymbol(4 /* Property */ | (optionalFlag != null ? optionalFlag : 0), name, syntheticFlag | checkFlags);
|
|
48587
|
-
result.containingType = containingType;
|
|
48644
|
+
result.links.containingType = containingType;
|
|
48588
48645
|
if (!hasNonUniformValueDeclaration && firstValueDeclaration) {
|
|
48589
48646
|
result.valueDeclaration = firstValueDeclaration;
|
|
48590
48647
|
if (firstValueDeclaration.symbol.parent) {
|
|
@@ -48592,16 +48649,16 @@ function createTypeChecker(host) {
|
|
|
48592
48649
|
}
|
|
48593
48650
|
}
|
|
48594
48651
|
result.declarations = declarations;
|
|
48595
|
-
result.nameType = nameType;
|
|
48652
|
+
result.links.nameType = nameType;
|
|
48596
48653
|
if (propTypes.length > 2) {
|
|
48597
|
-
result.checkFlags |= 65536 /* DeferredType */;
|
|
48598
|
-
result.deferralParent = containingType;
|
|
48599
|
-
result.deferralConstituents = propTypes;
|
|
48600
|
-
result.deferralWriteConstituents = writeTypes;
|
|
48654
|
+
result.links.checkFlags |= 65536 /* DeferredType */;
|
|
48655
|
+
result.links.deferralParent = containingType;
|
|
48656
|
+
result.links.deferralConstituents = propTypes;
|
|
48657
|
+
result.links.deferralWriteConstituents = writeTypes;
|
|
48601
48658
|
} else {
|
|
48602
|
-
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
48659
|
+
result.links.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
48603
48660
|
if (writeTypes) {
|
|
48604
|
-
result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
48661
|
+
result.links.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
48605
48662
|
}
|
|
48606
48663
|
}
|
|
48607
48664
|
return result;
|
|
@@ -48938,12 +48995,12 @@ function createTypeChecker(host) {
|
|
|
48938
48995
|
const lastParamVariadicType = firstDefined(lastParamTags, (p) => p.typeExpression && isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : void 0);
|
|
48939
48996
|
const syntheticArgsSymbol = createSymbol(3 /* Variable */, "args", 32768 /* RestParameter */);
|
|
48940
48997
|
if (lastParamVariadicType) {
|
|
48941
|
-
syntheticArgsSymbol.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
48998
|
+
syntheticArgsSymbol.links.type = createArrayType(getTypeFromTypeNode(lastParamVariadicType.type));
|
|
48942
48999
|
} else {
|
|
48943
|
-
syntheticArgsSymbol.checkFlags |= 65536 /* DeferredType */;
|
|
48944
|
-
syntheticArgsSymbol.deferralParent = neverType;
|
|
48945
|
-
syntheticArgsSymbol.deferralConstituents = [anyArrayType];
|
|
48946
|
-
syntheticArgsSymbol.deferralWriteConstituents = [anyArrayType];
|
|
49000
|
+
syntheticArgsSymbol.links.checkFlags |= 65536 /* DeferredType */;
|
|
49001
|
+
syntheticArgsSymbol.links.deferralParent = neverType;
|
|
49002
|
+
syntheticArgsSymbol.links.deferralConstituents = [anyArrayType];
|
|
49003
|
+
syntheticArgsSymbol.links.deferralWriteConstituents = [anyArrayType];
|
|
48947
49004
|
}
|
|
48948
49005
|
if (lastParamVariadicType) {
|
|
48949
49006
|
parameters.pop();
|
|
@@ -49557,7 +49614,7 @@ function createTypeChecker(host) {
|
|
|
49557
49614
|
if (!result) {
|
|
49558
49615
|
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
|
|
49559
49616
|
result.parent = parentSymbol;
|
|
49560
|
-
result.declaredType = unresolvedType;
|
|
49617
|
+
result.links.declaredType = unresolvedType;
|
|
49561
49618
|
}
|
|
49562
49619
|
return result;
|
|
49563
49620
|
}
|
|
@@ -49834,7 +49891,7 @@ function createTypeChecker(host) {
|
|
|
49834
49891
|
const importMetaType = getGlobalImportMetaType();
|
|
49835
49892
|
const metaPropertySymbol = createSymbol(4 /* Property */, "meta", 8 /* Readonly */);
|
|
49836
49893
|
metaPropertySymbol.parent = symbol;
|
|
49837
|
-
metaPropertySymbol.type = importMetaType;
|
|
49894
|
+
metaPropertySymbol.links.type = importMetaType;
|
|
49838
49895
|
const members = createSymbolTable([metaPropertySymbol]);
|
|
49839
49896
|
symbol.members = members;
|
|
49840
49897
|
deferredGlobalImportMetaExpressionType = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
@@ -50059,8 +50116,8 @@ function createTypeChecker(host) {
|
|
|
50059
50116
|
"" + i,
|
|
50060
50117
|
readonly ? 8 /* Readonly */ : 0
|
|
50061
50118
|
);
|
|
50062
|
-
property.tupleLabelDeclaration = namedMemberDeclarations == null ? void 0 : namedMemberDeclarations[i];
|
|
50063
|
-
property.type = typeParameter;
|
|
50119
|
+
property.links.tupleLabelDeclaration = namedMemberDeclarations == null ? void 0 : namedMemberDeclarations[i];
|
|
50120
|
+
property.links.type = typeParameter;
|
|
50064
50121
|
properties.push(property);
|
|
50065
50122
|
}
|
|
50066
50123
|
}
|
|
@@ -50068,12 +50125,12 @@ function createTypeChecker(host) {
|
|
|
50068
50125
|
const fixedLength = properties.length;
|
|
50069
50126
|
const lengthSymbol = createSymbol(4 /* Property */, "length", readonly ? 8 /* Readonly */ : 0);
|
|
50070
50127
|
if (combinedFlags & 12 /* Variable */) {
|
|
50071
|
-
lengthSymbol.type = numberType;
|
|
50128
|
+
lengthSymbol.links.type = numberType;
|
|
50072
50129
|
} else {
|
|
50073
50130
|
const literalTypes = [];
|
|
50074
50131
|
for (let i = minLength; i <= arity; i++)
|
|
50075
50132
|
literalTypes.push(getNumberLiteralType(i));
|
|
50076
|
-
lengthSymbol.type = getUnionType(literalTypes);
|
|
50133
|
+
lengthSymbol.links.type = getUnionType(literalTypes);
|
|
50077
50134
|
}
|
|
50078
50135
|
properties.push(lengthSymbol);
|
|
50079
50136
|
const type = createObjectType(8 /* Tuple */ | 4 /* Reference */);
|
|
@@ -51599,6 +51656,13 @@ function createTypeChecker(host) {
|
|
|
51599
51656
|
if (meaning === 111551 /* Value */) {
|
|
51600
51657
|
return getTypeOfSymbol(symbol);
|
|
51601
51658
|
} else {
|
|
51659
|
+
const type = tryGetDeclaredTypeOfSymbol(resolvedSymbol);
|
|
51660
|
+
const typeParameters = type && getTypeParametersForTypeAndSymbol(type, resolvedSymbol);
|
|
51661
|
+
if (node.typeArguments && typeParameters) {
|
|
51662
|
+
addLazyDiagnostic(() => {
|
|
51663
|
+
checkTypeArgumentConstraints(node, typeParameters);
|
|
51664
|
+
});
|
|
51665
|
+
}
|
|
51602
51666
|
return getTypeReferenceType(node, resolvedSymbol);
|
|
51603
51667
|
}
|
|
51604
51668
|
}
|
|
@@ -51660,10 +51724,10 @@ function createTypeChecker(host) {
|
|
|
51660
51724
|
const isSetonlyAccessor = prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */);
|
|
51661
51725
|
const flags = 4 /* Property */ | 16777216 /* Optional */;
|
|
51662
51726
|
const result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));
|
|
51663
|
-
result.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), true);
|
|
51727
|
+
result.links.type = isSetonlyAccessor ? undefinedType : addOptionality(getTypeOfSymbol(prop), true);
|
|
51664
51728
|
result.declarations = prop.declarations;
|
|
51665
|
-
result.nameType = getSymbolLinks(prop).nameType;
|
|
51666
|
-
result.syntheticOrigin = prop;
|
|
51729
|
+
result.links.nameType = getSymbolLinks(prop).nameType;
|
|
51730
|
+
result.links.syntheticOrigin = prop;
|
|
51667
51731
|
members.set(prop.escapedName, result);
|
|
51668
51732
|
}
|
|
51669
51733
|
}
|
|
@@ -51730,11 +51794,11 @@ function createTypeChecker(host) {
|
|
|
51730
51794
|
const declarations = concatenate(leftProp.declarations, rightProp.declarations);
|
|
51731
51795
|
const flags = 4 /* Property */ | leftProp.flags & 16777216 /* Optional */;
|
|
51732
51796
|
const result = createSymbol(flags, leftProp.escapedName);
|
|
51733
|
-
result.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], 2 /* Subtype */);
|
|
51734
|
-
result.leftSpread = leftProp;
|
|
51735
|
-
result.rightSpread = rightProp;
|
|
51797
|
+
result.links.type = getUnionType([getTypeOfSymbol(leftProp), removeMissingOrUndefinedType(rightType)], 2 /* Subtype */);
|
|
51798
|
+
result.links.leftSpread = leftProp;
|
|
51799
|
+
result.links.rightSpread = rightProp;
|
|
51736
51800
|
result.declarations = declarations;
|
|
51737
|
-
result.nameType = getSymbolLinks(leftProp).nameType;
|
|
51801
|
+
result.links.nameType = getSymbolLinks(leftProp).nameType;
|
|
51738
51802
|
members.set(leftProp.escapedName, result);
|
|
51739
51803
|
}
|
|
51740
51804
|
} else {
|
|
@@ -51756,10 +51820,10 @@ function createTypeChecker(host) {
|
|
|
51756
51820
|
}
|
|
51757
51821
|
const flags = 4 /* Property */ | prop.flags & 16777216 /* Optional */;
|
|
51758
51822
|
const result = createSymbol(flags, prop.escapedName, getIsLateCheckFlag(prop) | (readonly ? 8 /* Readonly */ : 0));
|
|
51759
|
-
result.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);
|
|
51823
|
+
result.links.type = isSetonlyAccessor ? undefinedType : getTypeOfSymbol(prop);
|
|
51760
51824
|
result.declarations = prop.declarations;
|
|
51761
|
-
result.nameType = getSymbolLinks(prop).nameType;
|
|
51762
|
-
result.syntheticOrigin = prop;
|
|
51825
|
+
result.links.nameType = getSymbolLinks(prop).nameType;
|
|
51826
|
+
result.links.syntheticOrigin = prop;
|
|
51763
51827
|
return result;
|
|
51764
51828
|
}
|
|
51765
51829
|
function getIndexInfoWithReadonly(info, readonly) {
|
|
@@ -52124,13 +52188,13 @@ function createTypeChecker(host) {
|
|
|
52124
52188
|
const result = createSymbol(symbol.flags, symbol.escapedName, 1 /* Instantiated */ | getCheckFlags(symbol) & (8 /* Readonly */ | 4096 /* Late */ | 16384 /* OptionalParameter */ | 32768 /* RestParameter */));
|
|
52125
52189
|
result.declarations = symbol.declarations;
|
|
52126
52190
|
result.parent = symbol.parent;
|
|
52127
|
-
result.target = symbol;
|
|
52128
|
-
result.mapper = mapper;
|
|
52191
|
+
result.links.target = symbol;
|
|
52192
|
+
result.links.mapper = mapper;
|
|
52129
52193
|
if (symbol.valueDeclaration) {
|
|
52130
52194
|
result.valueDeclaration = symbol.valueDeclaration;
|
|
52131
52195
|
}
|
|
52132
52196
|
if (links.nameType) {
|
|
52133
|
-
result.nameType = links.nameType;
|
|
52197
|
+
result.links.nameType = links.nameType;
|
|
52134
52198
|
}
|
|
52135
52199
|
return result;
|
|
52136
52200
|
}
|
|
@@ -55023,7 +55087,14 @@ function createTypeChecker(host) {
|
|
|
55023
55087
|
if (match === -1) {
|
|
55024
55088
|
return defaultValue;
|
|
55025
55089
|
}
|
|
55026
|
-
|
|
55090
|
+
let nextMatch = discriminable.indexOf(true, match + 1);
|
|
55091
|
+
while (nextMatch !== -1) {
|
|
55092
|
+
if (!isTypeIdenticalTo(target.types[match], target.types[nextMatch])) {
|
|
55093
|
+
return defaultValue;
|
|
55094
|
+
}
|
|
55095
|
+
nextMatch = discriminable.indexOf(true, nextMatch + 1);
|
|
55096
|
+
}
|
|
55097
|
+
return target.types[match];
|
|
55027
55098
|
}
|
|
55028
55099
|
function isWeakType(type) {
|
|
55029
55100
|
if (type.flags & 524288 /* Object */) {
|
|
@@ -55161,7 +55232,7 @@ function createTypeChecker(host) {
|
|
|
55161
55232
|
}
|
|
55162
55233
|
function forEachProperty(prop, callback) {
|
|
55163
55234
|
if (getCheckFlags(prop) & 6 /* Synthetic */) {
|
|
55164
|
-
for (const t of prop.containingType.types) {
|
|
55235
|
+
for (const t of prop.links.containingType.types) {
|
|
55165
55236
|
const p = getPropertyOfType(t, prop.escapedName);
|
|
55166
55237
|
const result = p && forEachProperty(p, callback);
|
|
55167
55238
|
if (result) {
|
|
@@ -55575,14 +55646,14 @@ function createTypeChecker(host) {
|
|
|
55575
55646
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
55576
55647
|
symbol.declarations = source.declarations;
|
|
55577
55648
|
symbol.parent = source.parent;
|
|
55578
|
-
symbol.type = type;
|
|
55579
|
-
symbol.target = source;
|
|
55649
|
+
symbol.links.type = type;
|
|
55650
|
+
symbol.links.target = source;
|
|
55580
55651
|
if (source.valueDeclaration) {
|
|
55581
55652
|
symbol.valueDeclaration = source.valueDeclaration;
|
|
55582
55653
|
}
|
|
55583
55654
|
const nameType = getSymbolLinks(source).nameType;
|
|
55584
55655
|
if (nameType) {
|
|
55585
|
-
symbol.nameType = nameType;
|
|
55656
|
+
symbol.links.nameType = nameType;
|
|
55586
55657
|
}
|
|
55587
55658
|
return symbol;
|
|
55588
55659
|
}
|
|
@@ -55963,7 +56034,7 @@ function createTypeChecker(host) {
|
|
|
55963
56034
|
}
|
|
55964
56035
|
const name = escapeLeadingUnderscores(t.value);
|
|
55965
56036
|
const literalProp = createSymbol(4 /* Property */, name);
|
|
55966
|
-
literalProp.type = anyType;
|
|
56037
|
+
literalProp.links.type = anyType;
|
|
55967
56038
|
if (t.symbol) {
|
|
55968
56039
|
literalProp.declarations = t.symbol.declarations;
|
|
55969
56040
|
literalProp.valueDeclaration = t.symbol.valueDeclaration;
|
|
@@ -56011,7 +56082,7 @@ function createTypeChecker(host) {
|
|
|
56011
56082
|
function getTypeOfReverseMappedSymbol(symbol) {
|
|
56012
56083
|
const links = getSymbolLinks(symbol);
|
|
56013
56084
|
if (!links.type) {
|
|
56014
|
-
links.type = inferReverseMappedType(symbol.propertyType, symbol.mappedType, symbol.constraintType);
|
|
56085
|
+
links.type = inferReverseMappedType(symbol.links.propertyType, symbol.links.mappedType, symbol.links.constraintType);
|
|
56015
56086
|
}
|
|
56016
56087
|
return links.type;
|
|
56017
56088
|
}
|
|
@@ -56994,10 +57065,10 @@ function createTypeChecker(host) {
|
|
|
56994
57065
|
if (type && type.flags & 1048576 /* Union */) {
|
|
56995
57066
|
const prop = getUnionOrIntersectionProperty(type, name);
|
|
56996
57067
|
if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) {
|
|
56997
|
-
if (prop.isDiscriminantProperty === void 0) {
|
|
56998
|
-
prop.isDiscriminantProperty = (prop.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop));
|
|
57068
|
+
if (prop.links.isDiscriminantProperty === void 0) {
|
|
57069
|
+
prop.links.isDiscriminantProperty = (prop.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop));
|
|
56999
57070
|
}
|
|
57000
|
-
return !!prop.isDiscriminantProperty;
|
|
57071
|
+
return !!prop.links.isDiscriminantProperty;
|
|
57001
57072
|
}
|
|
57002
57073
|
}
|
|
57003
57074
|
return false;
|
|
@@ -57519,7 +57590,7 @@ function createTypeChecker(host) {
|
|
|
57519
57590
|
}
|
|
57520
57591
|
if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {
|
|
57521
57592
|
if (getCheckFlags(symbol) & 262144 /* Mapped */) {
|
|
57522
|
-
const origin = symbol.syntheticOrigin;
|
|
57593
|
+
const origin = symbol.links.syntheticOrigin;
|
|
57523
57594
|
if (origin && getExplicitTypeOfSymbol(origin)) {
|
|
57524
57595
|
return getTypeOfSymbol(symbol);
|
|
57525
57596
|
}
|
|
@@ -59600,7 +59671,7 @@ function createTypeChecker(host) {
|
|
|
59600
59671
|
return nameStr !== void 0 && getTypeOfPropertyOfContextualType(thisType, nameStr) || void 0;
|
|
59601
59672
|
}
|
|
59602
59673
|
function isCircularMappedProperty(symbol) {
|
|
59603
|
-
return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0);
|
|
59674
|
+
return !!(getCheckFlags(symbol) & 262144 /* Mapped */ && !symbol.links.type && findResolutionCycleStartIndex(symbol, 0 /* Type */) >= 0);
|
|
59604
59675
|
}
|
|
59605
59676
|
function getTypeOfPropertyOfContextualType(type, name, nameType) {
|
|
59606
59677
|
return mapType(type, (t) => {
|
|
@@ -59841,6 +59912,9 @@ function createTypeChecker(host) {
|
|
|
59841
59912
|
Debug.assert(parent.parent.kind === 225 /* TemplateExpression */);
|
|
59842
59913
|
return getContextualTypeForSubstitutionExpression(parent.parent, node);
|
|
59843
59914
|
case 214 /* ParenthesizedExpression */: {
|
|
59915
|
+
if (isJSDocSatisfiesExpression(parent)) {
|
|
59916
|
+
return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent));
|
|
59917
|
+
}
|
|
59844
59918
|
const tag = isInJSFile(parent) ? getJSDocTypeTag(parent) : void 0;
|
|
59845
59919
|
return !tag ? getContextualType(parent, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(tag.typeExpression.type);
|
|
59846
59920
|
}
|
|
@@ -60022,14 +60096,14 @@ function createTypeChecker(host) {
|
|
|
60022
60096
|
1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0),
|
|
60023
60097
|
paramName || `arg${i}`
|
|
60024
60098
|
);
|
|
60025
|
-
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
60099
|
+
paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
60026
60100
|
params[i] = paramSymbol;
|
|
60027
60101
|
}
|
|
60028
60102
|
if (needsExtraRestElement) {
|
|
60029
60103
|
const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args");
|
|
60030
|
-
restParamSymbol.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
60104
|
+
restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount));
|
|
60031
60105
|
if (shorter === right) {
|
|
60032
|
-
restParamSymbol.type = instantiateType(restParamSymbol.type, mapper);
|
|
60106
|
+
restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper);
|
|
60033
60107
|
}
|
|
60034
60108
|
params[longestCount] = restParamSymbol;
|
|
60035
60109
|
}
|
|
@@ -60260,6 +60334,7 @@ function createTypeChecker(host) {
|
|
|
60260
60334
|
return links.immediateTarget;
|
|
60261
60335
|
}
|
|
60262
60336
|
function checkObjectLiteral(node, checkMode) {
|
|
60337
|
+
var _a2;
|
|
60263
60338
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
60264
60339
|
checkGrammarObjectLiteralExpression(node, inDestructuringPattern);
|
|
60265
60340
|
const allPropertiesTable = strictNullChecks ? createSymbolTable() : void 0;
|
|
@@ -60302,7 +60377,7 @@ function createTypeChecker(host) {
|
|
|
60302
60377
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
60303
60378
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
60304
60379
|
if (nameType) {
|
|
60305
|
-
prop.nameType = nameType;
|
|
60380
|
+
prop.links.nameType = nameType;
|
|
60306
60381
|
}
|
|
60307
60382
|
if (inDestructuringPattern) {
|
|
60308
60383
|
const isOptional = memberDecl.kind === 299 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer) || memberDecl.kind === 300 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer;
|
|
@@ -60327,8 +60402,8 @@ function createTypeChecker(host) {
|
|
|
60327
60402
|
if (member.valueDeclaration) {
|
|
60328
60403
|
prop.valueDeclaration = member.valueDeclaration;
|
|
60329
60404
|
}
|
|
60330
|
-
prop.type = type;
|
|
60331
|
-
prop.target = member;
|
|
60405
|
+
prop.links.type = type;
|
|
60406
|
+
prop.links.target = member;
|
|
60332
60407
|
member = prop;
|
|
60333
60408
|
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
60334
60409
|
if (contextualType && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 299 /* PropertyAssignment */ || memberDecl.kind === 171 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
|
|
@@ -60401,7 +60476,7 @@ function createTypeChecker(host) {
|
|
|
60401
60476
|
if (!propertiesTable.get(prop.escapedName) && !getPropertyOfType(spread, prop.escapedName)) {
|
|
60402
60477
|
if (!(prop.flags & 16777216 /* Optional */)) {
|
|
60403
60478
|
error(
|
|
60404
|
-
prop.valueDeclaration || prop.bindingElement,
|
|
60479
|
+
prop.valueDeclaration || ((_a2 = tryCast(prop, isTransientSymbol)) == null ? void 0 : _a2.links.bindingElement),
|
|
60405
60480
|
Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value
|
|
60406
60481
|
);
|
|
60407
60482
|
}
|
|
@@ -60511,8 +60586,8 @@ function createTypeChecker(host) {
|
|
|
60511
60586
|
if (member.valueDeclaration) {
|
|
60512
60587
|
attributeSymbol.valueDeclaration = member.valueDeclaration;
|
|
60513
60588
|
}
|
|
60514
|
-
attributeSymbol.type = exprType;
|
|
60515
|
-
attributeSymbol.target = member;
|
|
60589
|
+
attributeSymbol.links.type = exprType;
|
|
60590
|
+
attributeSymbol.links.target = member;
|
|
60516
60591
|
attributesTable.set(attributeSymbol.escapedName, attributeSymbol);
|
|
60517
60592
|
allAttributesTable == null ? void 0 : allAttributesTable.set(attributeSymbol.escapedName, attributeSymbol);
|
|
60518
60593
|
if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
|
|
@@ -60560,7 +60635,7 @@ function createTypeChecker(host) {
|
|
|
60560
60635
|
const contextualType = getApparentTypeOfContextualType(openingLikeElement.attributes, void 0);
|
|
60561
60636
|
const childrenContextualType = contextualType && getTypeOfPropertyOfContextualType(contextualType, jsxChildrenPropertyName);
|
|
60562
60637
|
const childrenPropSymbol = createSymbol(4 /* Property */, jsxChildrenPropertyName);
|
|
60563
|
-
childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
60638
|
+
childrenPropSymbol.links.type = childrenTypes.length === 1 ? childrenTypes[0] : childrenContextualType && someType(childrenContextualType, isTupleLikeType) ? createTupleType(childrenTypes) : createArrayType(getUnionType(childrenTypes));
|
|
60564
60639
|
childrenPropSymbol.valueDeclaration = factory.createPropertySignature(void 0, unescapeLeadingUnderscores(jsxChildrenPropertyName), void 0, void 0);
|
|
60565
60640
|
setParent(childrenPropSymbol.valueDeclaration, attributes);
|
|
60566
60641
|
childrenPropSymbol.valueDeclaration.symbol = childrenPropSymbol;
|
|
@@ -60666,7 +60741,7 @@ function createTypeChecker(host) {
|
|
|
60666
60741
|
return void 0;
|
|
60667
60742
|
}
|
|
60668
60743
|
const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
|
|
60669
|
-
const errorMessage = isClassic ? Diagnostics.
|
|
60744
|
+
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;
|
|
60670
60745
|
const mod = resolveExternalModule(location, runtimeImportSpecifier, errorMessage, location);
|
|
60671
60746
|
const result = mod && mod !== unknownSymbol ? getMergedSymbol(resolveSymbol(mod)) : void 0;
|
|
60672
60747
|
if (links) {
|
|
@@ -63071,7 +63146,7 @@ function createTypeChecker(host) {
|
|
|
63071
63146
|
returnNode ? factory.createTypeReferenceNode(returnNode, void 0) : factory.createKeywordTypeNode(131 /* AnyKeyword */)
|
|
63072
63147
|
);
|
|
63073
63148
|
const parameterSymbol = createSymbol(1 /* FunctionScopedVariable */, "props");
|
|
63074
|
-
parameterSymbol.type = result;
|
|
63149
|
+
parameterSymbol.links.type = result;
|
|
63075
63150
|
return createSignature(
|
|
63076
63151
|
declaration,
|
|
63077
63152
|
void 0,
|
|
@@ -63364,8 +63439,8 @@ function createTypeChecker(host) {
|
|
|
63364
63439
|
const memberTable = createSymbolTable();
|
|
63365
63440
|
const newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */);
|
|
63366
63441
|
newSymbol.parent = originalSymbol;
|
|
63367
|
-
newSymbol.nameType = getStringLiteralType("default");
|
|
63368
|
-
newSymbol.aliasTarget = resolveSymbol(symbol);
|
|
63442
|
+
newSymbol.links.nameType = getStringLiteralType("default");
|
|
63443
|
+
newSymbol.links.aliasTarget = resolveSymbol(symbol);
|
|
63369
63444
|
memberTable.set("default" /* Default */, newSymbol);
|
|
63370
63445
|
return createAnonymousType(anonymousSymbol, memberTable, emptyArray, emptyArray, emptyArray);
|
|
63371
63446
|
}
|
|
@@ -63391,7 +63466,7 @@ function createTypeChecker(host) {
|
|
|
63391
63466
|
if (hasSyntheticDefault) {
|
|
63392
63467
|
const anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
63393
63468
|
const defaultContainingObject = createDefaultPropertyWrapperForModule(symbol, originalSymbol, anonymousSymbol);
|
|
63394
|
-
anonymousSymbol.type = defaultContainingObject;
|
|
63469
|
+
anonymousSymbol.links.type = defaultContainingObject;
|
|
63395
63470
|
synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, false) : defaultContainingObject;
|
|
63396
63471
|
} else {
|
|
63397
63472
|
synthType.syntheticType = type;
|
|
@@ -63567,12 +63642,15 @@ function createTypeChecker(host) {
|
|
|
63567
63642
|
}
|
|
63568
63643
|
function checkSatisfiesExpression(node) {
|
|
63569
63644
|
checkSourceElement(node.type);
|
|
63570
|
-
|
|
63571
|
-
|
|
63645
|
+
return checkSatisfiesExpressionWorker(node.expression, node.type);
|
|
63646
|
+
}
|
|
63647
|
+
function checkSatisfiesExpressionWorker(expression, target, checkMode) {
|
|
63648
|
+
const exprType = checkExpression(expression, checkMode);
|
|
63649
|
+
const targetType = getTypeFromTypeNode(target);
|
|
63572
63650
|
if (isErrorType(targetType)) {
|
|
63573
63651
|
return targetType;
|
|
63574
63652
|
}
|
|
63575
|
-
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType,
|
|
63653
|
+
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, target, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
63576
63654
|
return exprType;
|
|
63577
63655
|
}
|
|
63578
63656
|
function checkMetaProperty(node) {
|
|
@@ -63926,7 +64004,7 @@ function createTypeChecker(host) {
|
|
|
63926
64004
|
const symbol = createSymbol(0 /* None */, "NewTargetExpression");
|
|
63927
64005
|
const targetPropertySymbol = createSymbol(4 /* Property */, "target", 8 /* Readonly */);
|
|
63928
64006
|
targetPropertySymbol.parent = symbol;
|
|
63929
|
-
targetPropertySymbol.type = targetType;
|
|
64007
|
+
targetPropertySymbol.links.type = targetType;
|
|
63930
64008
|
const members = createSymbolTable([targetPropertySymbol]);
|
|
63931
64009
|
symbol.members = members;
|
|
63932
64010
|
return createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
@@ -65687,9 +65765,14 @@ function createTypeChecker(host) {
|
|
|
65687
65765
|
}
|
|
65688
65766
|
}
|
|
65689
65767
|
function checkParenthesizedExpression(node, checkMode) {
|
|
65690
|
-
if (hasJSDocNodes(node)
|
|
65691
|
-
|
|
65692
|
-
|
|
65768
|
+
if (hasJSDocNodes(node)) {
|
|
65769
|
+
if (isJSDocSatisfiesExpression(node)) {
|
|
65770
|
+
return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode);
|
|
65771
|
+
}
|
|
65772
|
+
if (isJSDocTypeAssertion(node)) {
|
|
65773
|
+
const type = getJSDocTypeAssertionType(node);
|
|
65774
|
+
return checkAssertionWorker(type, type, node.expression, checkMode);
|
|
65775
|
+
}
|
|
65693
65776
|
}
|
|
65694
65777
|
return checkExpression(node.expression, checkMode);
|
|
65695
65778
|
}
|
|
@@ -66374,12 +66457,18 @@ function createTypeChecker(host) {
|
|
|
66374
66457
|
}
|
|
66375
66458
|
return result;
|
|
66376
66459
|
}
|
|
66460
|
+
function getTypeParametersForTypeAndSymbol(type, symbol) {
|
|
66461
|
+
if (!isErrorType(type)) {
|
|
66462
|
+
return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters || (getObjectFlags(type) & 4 /* Reference */ ? type.target.localTypeParameters : void 0);
|
|
66463
|
+
}
|
|
66464
|
+
return void 0;
|
|
66465
|
+
}
|
|
66377
66466
|
function getTypeParametersForTypeReference(node) {
|
|
66378
66467
|
const type = getTypeFromTypeReference(node);
|
|
66379
66468
|
if (!isErrorType(type)) {
|
|
66380
66469
|
const symbol = getNodeLinks(node).resolvedSymbol;
|
|
66381
66470
|
if (symbol) {
|
|
66382
|
-
return
|
|
66471
|
+
return getTypeParametersForTypeAndSymbol(type, symbol);
|
|
66383
66472
|
}
|
|
66384
66473
|
}
|
|
66385
66474
|
return void 0;
|
|
@@ -67317,6 +67406,9 @@ function createTypeChecker(host) {
|
|
|
67317
67406
|
function checkJSDocTypeTag(node) {
|
|
67318
67407
|
checkSourceElement(node.typeExpression);
|
|
67319
67408
|
}
|
|
67409
|
+
function checkJSDocSatisfiesTag(node) {
|
|
67410
|
+
checkSourceElement(node.typeExpression);
|
|
67411
|
+
}
|
|
67320
67412
|
function checkJSDocLinkLikeTag(node) {
|
|
67321
67413
|
if (node.name) {
|
|
67322
67414
|
resolveJSDocMemberName(node.name, true);
|
|
@@ -69458,7 +69550,7 @@ function createTypeChecker(host) {
|
|
|
69458
69550
|
);
|
|
69459
69551
|
}
|
|
69460
69552
|
function getTargetSymbol(s) {
|
|
69461
|
-
return getCheckFlags(s) & 1 /* Instantiated */ ? s.target : s;
|
|
69553
|
+
return getCheckFlags(s) & 1 /* Instantiated */ ? s.links.target : s;
|
|
69462
69554
|
}
|
|
69463
69555
|
function getClassOrInterfaceDeclarationsOfSymbol(symbol) {
|
|
69464
69556
|
return filter(symbol.declarations, (d) => d.kind === 260 /* ClassDeclaration */ || d.kind === 261 /* InterfaceDeclaration */);
|
|
@@ -70658,6 +70750,8 @@ function createTypeChecker(host) {
|
|
|
70658
70750
|
case 338 /* JSDocProtectedTag */:
|
|
70659
70751
|
case 337 /* JSDocPrivateTag */:
|
|
70660
70752
|
return checkJSDocAccessibilityModifiers(node);
|
|
70753
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
70754
|
+
return checkJSDocSatisfiesTag(node);
|
|
70661
70755
|
case 196 /* IndexedAccessType */:
|
|
70662
70756
|
return checkIndexedAccessType(node);
|
|
70663
70757
|
case 197 /* MappedType */:
|
|
@@ -71521,7 +71615,7 @@ function createTypeChecker(host) {
|
|
|
71521
71615
|
if (getCheckFlags(symbol) & 6 /* Synthetic */) {
|
|
71522
71616
|
return mapDefined(getSymbolLinks(symbol).containingType.types, (type) => getPropertyOfType(type, symbol.escapedName));
|
|
71523
71617
|
} else if (symbol.flags & 33554432 /* Transient */) {
|
|
71524
|
-
const { leftSpread, rightSpread, syntheticOrigin } = symbol;
|
|
71618
|
+
const { links: { leftSpread, rightSpread, syntheticOrigin } } = symbol;
|
|
71525
71619
|
return leftSpread ? [leftSpread, rightSpread] : syntheticOrigin ? [syntheticOrigin] : singleElementArray(tryGetTarget(symbol));
|
|
71526
71620
|
}
|
|
71527
71621
|
return void 0;
|
|
@@ -75180,13 +75274,13 @@ var visitEachChildTable = {
|
|
|
75180
75274
|
visitLexicalEnvironment(node.statements, visitor, context)
|
|
75181
75275
|
);
|
|
75182
75276
|
},
|
|
75183
|
-
[
|
|
75277
|
+
[356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
75184
75278
|
return context.factory.updatePartiallyEmittedExpression(
|
|
75185
75279
|
node,
|
|
75186
75280
|
nodeVisitor(node.expression, visitor, isExpression)
|
|
75187
75281
|
);
|
|
75188
75282
|
},
|
|
75189
|
-
[
|
|
75283
|
+
[357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
75190
75284
|
return context.factory.updateCommaListExpression(
|
|
75191
75285
|
node,
|
|
75192
75286
|
nodesVisitor(node.elements, visitor, isExpression)
|
|
@@ -78766,7 +78860,7 @@ function transformClassFields(context) {
|
|
|
78766
78860
|
if (isClassWithConstructorReference) {
|
|
78767
78861
|
enableSubstitutionForClassAliases();
|
|
78768
78862
|
const alias = factory2.cloneNode(temp);
|
|
78769
|
-
alias.
|
|
78863
|
+
alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
|
|
78770
78864
|
classAliases[getOriginalNodeId(node)] = alias;
|
|
78771
78865
|
}
|
|
78772
78866
|
setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression));
|
|
@@ -81085,7 +81179,7 @@ function transformES2018(context) {
|
|
|
81085
81179
|
return visitObjectLiteralExpression(node);
|
|
81086
81180
|
case 223 /* BinaryExpression */:
|
|
81087
81181
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
81088
|
-
case
|
|
81182
|
+
case 357 /* CommaListExpression */:
|
|
81089
81183
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
81090
81184
|
case 295 /* CatchClause */:
|
|
81091
81185
|
return visitCatchClause(node);
|
|
@@ -83281,7 +83375,7 @@ function transformES2015(context) {
|
|
|
83281
83375
|
return visitParenthesizedExpression(node, expressionResultIsUnused2);
|
|
83282
83376
|
case 223 /* BinaryExpression */:
|
|
83283
83377
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
83284
|
-
case
|
|
83378
|
+
case 357 /* CommaListExpression */:
|
|
83285
83379
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
83286
83380
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
83287
83381
|
case 15 /* TemplateHead */:
|
|
@@ -85976,7 +86070,7 @@ function transformGenerators(context) {
|
|
|
85976
86070
|
switch (node.kind) {
|
|
85977
86071
|
case 223 /* BinaryExpression */:
|
|
85978
86072
|
return visitBinaryExpression(node);
|
|
85979
|
-
case
|
|
86073
|
+
case 357 /* CommaListExpression */:
|
|
85980
86074
|
return visitCommaListExpression(node);
|
|
85981
86075
|
case 224 /* ConditionalExpression */:
|
|
85982
86076
|
return visitConditionalExpression(node);
|
|
@@ -88061,9 +88155,9 @@ function transformModule(context) {
|
|
|
88061
88155
|
return visitFunctionDeclaration(node);
|
|
88062
88156
|
case 260 /* ClassDeclaration */:
|
|
88063
88157
|
return visitClassDeclaration(node);
|
|
88064
|
-
case
|
|
88158
|
+
case 358 /* MergeDeclarationMarker */:
|
|
88065
88159
|
return visitMergeDeclarationMarker(node);
|
|
88066
|
-
case
|
|
88160
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
88067
88161
|
return visitEndOfDeclarationMarker(node);
|
|
88068
88162
|
default:
|
|
88069
88163
|
return visitor(node);
|
|
@@ -88080,7 +88174,7 @@ function transformModule(context) {
|
|
|
88080
88174
|
return visitExpressionStatement(node);
|
|
88081
88175
|
case 214 /* ParenthesizedExpression */:
|
|
88082
88176
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
88083
|
-
case
|
|
88177
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
88084
88178
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
88085
88179
|
case 210 /* CallExpression */:
|
|
88086
88180
|
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
@@ -89062,7 +89156,7 @@ function transformModule(context) {
|
|
|
89062
89156
|
return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
|
|
89063
89157
|
}
|
|
89064
89158
|
return node;
|
|
89065
|
-
} else if (!(isGeneratedIdentifier(node) && !(node.
|
|
89159
|
+
} else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
|
|
89066
89160
|
const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
|
|
89067
89161
|
if (exportContainer && exportContainer.kind === 308 /* SourceFile */) {
|
|
89068
89162
|
return setTextRange(
|
|
@@ -89855,9 +89949,9 @@ function transformSystemModule(context) {
|
|
|
89855
89949
|
return visitCatchClause(node);
|
|
89856
89950
|
case 238 /* Block */:
|
|
89857
89951
|
return visitBlock(node);
|
|
89858
|
-
case
|
|
89952
|
+
case 358 /* MergeDeclarationMarker */:
|
|
89859
89953
|
return visitMergeDeclarationMarker(node);
|
|
89860
|
-
case
|
|
89954
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
89861
89955
|
return visitEndOfDeclarationMarker(node);
|
|
89862
89956
|
default:
|
|
89863
89957
|
return visitor(node);
|
|
@@ -90005,7 +90099,7 @@ function transformSystemModule(context) {
|
|
|
90005
90099
|
return visitExpressionStatement(node);
|
|
90006
90100
|
case 214 /* ParenthesizedExpression */:
|
|
90007
90101
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
90008
|
-
case
|
|
90102
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
90009
90103
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
90010
90104
|
case 223 /* BinaryExpression */:
|
|
90011
90105
|
if (isDestructuringAssignment(node)) {
|
|
@@ -92406,7 +92500,7 @@ function noEmitNotification(hint, node, callback) {
|
|
|
92406
92500
|
}
|
|
92407
92501
|
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
|
|
92408
92502
|
var _a2, _b;
|
|
92409
|
-
const enabledSyntaxKindFeatures = new Array(
|
|
92503
|
+
const enabledSyntaxKindFeatures = new Array(361 /* Count */);
|
|
92410
92504
|
let lexicalEnvironmentVariableDeclarations;
|
|
92411
92505
|
let lexicalEnvironmentFunctionDeclarations;
|
|
92412
92506
|
let lexicalEnvironmentStatements;
|
|
@@ -94116,6 +94210,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
94116
94210
|
case 346 /* JSDocThisTag */:
|
|
94117
94211
|
case 347 /* JSDocTypeTag */:
|
|
94118
94212
|
case 352 /* JSDocThrowsTag */:
|
|
94213
|
+
case 353 /* JSDocSatisfiesTag */:
|
|
94119
94214
|
return emitJSDocSimpleTypedTag(node);
|
|
94120
94215
|
case 348 /* JSDocTemplateTag */:
|
|
94121
94216
|
return emitJSDocTemplateTag(node);
|
|
@@ -94123,9 +94218,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
94123
94218
|
return emitJSDocTypedefTag(node);
|
|
94124
94219
|
case 350 /* JSDocSeeTag */:
|
|
94125
94220
|
return emitJSDocSeeTag(node);
|
|
94126
|
-
case
|
|
94127
|
-
case
|
|
94128
|
-
case
|
|
94221
|
+
case 355 /* NotEmittedStatement */:
|
|
94222
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
94223
|
+
case 358 /* MergeDeclarationMarker */:
|
|
94129
94224
|
return;
|
|
94130
94225
|
}
|
|
94131
94226
|
if (isExpression(node)) {
|
|
@@ -94220,18 +94315,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
94220
94315
|
return emitJsxSelfClosingElement(node);
|
|
94221
94316
|
case 285 /* JsxFragment */:
|
|
94222
94317
|
return emitJsxFragment(node);
|
|
94223
|
-
case
|
|
94318
|
+
case 354 /* SyntaxList */:
|
|
94224
94319
|
return Debug.fail("SyntaxList should not be printed");
|
|
94225
|
-
case
|
|
94320
|
+
case 355 /* NotEmittedStatement */:
|
|
94226
94321
|
return;
|
|
94227
|
-
case
|
|
94322
|
+
case 356 /* PartiallyEmittedExpression */:
|
|
94228
94323
|
return emitPartiallyEmittedExpression(node);
|
|
94229
|
-
case
|
|
94324
|
+
case 357 /* CommaListExpression */:
|
|
94230
94325
|
return emitCommaList(node);
|
|
94231
|
-
case
|
|
94232
|
-
case
|
|
94326
|
+
case 358 /* MergeDeclarationMarker */:
|
|
94327
|
+
case 359 /* EndOfDeclarationMarker */:
|
|
94233
94328
|
return;
|
|
94234
|
-
case
|
|
94329
|
+
case 360 /* SyntheticReferenceExpression */:
|
|
94235
94330
|
return Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
94236
94331
|
}
|
|
94237
94332
|
}
|
|
@@ -96906,10 +97001,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96906
97001
|
}
|
|
96907
97002
|
}
|
|
96908
97003
|
function generateName(name) {
|
|
96909
|
-
if ((name.
|
|
96910
|
-
return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.
|
|
97004
|
+
if ((name.autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) {
|
|
97005
|
+
return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerate.flags, name.autoGenerate.prefix, name.autoGenerate.suffix);
|
|
96911
97006
|
} else {
|
|
96912
|
-
const autoGenerateId = name.
|
|
97007
|
+
const autoGenerateId = name.autoGenerate.id;
|
|
96913
97008
|
return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name));
|
|
96914
97009
|
}
|
|
96915
97010
|
}
|
|
@@ -97092,26 +97187,26 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
97092
97187
|
}
|
|
97093
97188
|
}
|
|
97094
97189
|
function makeName(name) {
|
|
97095
|
-
const prefix = formatGeneratedNamePart(name.
|
|
97096
|
-
const suffix = formatGeneratedNamePart(name.
|
|
97097
|
-
switch (name.
|
|
97190
|
+
const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName);
|
|
97191
|
+
const suffix = formatGeneratedNamePart(name.autoGenerate.suffix);
|
|
97192
|
+
switch (name.autoGenerate.flags & 7 /* KindMask */) {
|
|
97098
97193
|
case 1 /* Auto */:
|
|
97099
|
-
return makeTempVariableName(TempFlags.Auto, !!(name.
|
|
97194
|
+
return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
|
|
97100
97195
|
case 2 /* Loop */:
|
|
97101
97196
|
Debug.assertNode(name, isIdentifier);
|
|
97102
|
-
return makeTempVariableName(TempFlags._i, !!(name.
|
|
97197
|
+
return makeTempVariableName(TempFlags._i, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), false, prefix, suffix);
|
|
97103
97198
|
case 3 /* Unique */:
|
|
97104
97199
|
return makeUniqueName(
|
|
97105
97200
|
idText(name),
|
|
97106
|
-
name.
|
|
97107
|
-
!!(name.
|
|
97108
|
-
!!(name.
|
|
97201
|
+
name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
|
|
97202
|
+
!!(name.autoGenerate.flags & 16 /* Optimistic */),
|
|
97203
|
+
!!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */),
|
|
97109
97204
|
isPrivateIdentifier(name),
|
|
97110
97205
|
prefix,
|
|
97111
97206
|
suffix
|
|
97112
97207
|
);
|
|
97113
97208
|
}
|
|
97114
|
-
return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(name.
|
|
97209
|
+
return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(name.autoGenerate.flags & 7 /* KindMask */, GeneratedIdentifierFlags, true)}.`);
|
|
97115
97210
|
}
|
|
97116
97211
|
function pipelineEmitWithComments(hint, node) {
|
|
97117
97212
|
const pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node);
|
|
@@ -97149,7 +97244,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
97149
97244
|
const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
|
|
97150
97245
|
if ((pos > 0 || end > 0) && pos !== end) {
|
|
97151
97246
|
if (!skipLeadingComments) {
|
|
97152
|
-
emitLeadingComments(pos, node.kind !==
|
|
97247
|
+
emitLeadingComments(pos, node.kind !== 355 /* NotEmittedStatement */);
|
|
97153
97248
|
}
|
|
97154
97249
|
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
97155
97250
|
containerPos = pos;
|
|
@@ -97172,7 +97267,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
97172
97267
|
containerPos = savedContainerPos;
|
|
97173
97268
|
containerEnd = savedContainerEnd;
|
|
97174
97269
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
97175
|
-
if (!skipTrailingComments && node.kind !==
|
|
97270
|
+
if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) {
|
|
97176
97271
|
emitTrailingComments(end);
|
|
97177
97272
|
}
|
|
97178
97273
|
}
|
|
@@ -97424,7 +97519,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
97424
97519
|
}
|
|
97425
97520
|
} else {
|
|
97426
97521
|
const source = sourceMapRange.source || sourceMapSource;
|
|
97427
|
-
if (node.kind !==
|
|
97522
|
+
if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
97428
97523
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
97429
97524
|
}
|
|
97430
97525
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
@@ -97439,7 +97534,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
97439
97534
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
97440
97535
|
sourceMapsDisabled = false;
|
|
97441
97536
|
}
|
|
97442
|
-
if (node.kind !==
|
|
97537
|
+
if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
97443
97538
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
97444
97539
|
}
|
|
97445
97540
|
}
|
|
@@ -98700,19 +98795,20 @@ function shouldProgramCreateNewSourceFiles(program, newOptions) {
|
|
|
98700
98795
|
return false;
|
|
98701
98796
|
return optionsHaveChanges(program.getCompilerOptions(), newOptions, sourceFileAffectingCompilerOptions);
|
|
98702
98797
|
}
|
|
98703
|
-
function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics) {
|
|
98798
|
+
function createCreateProgramOptions(rootNames, options, host, oldProgram, configFileParsingDiagnostics, typeScriptVersion2) {
|
|
98704
98799
|
return {
|
|
98705
98800
|
rootNames,
|
|
98706
98801
|
options,
|
|
98707
98802
|
host,
|
|
98708
98803
|
oldProgram,
|
|
98709
|
-
configFileParsingDiagnostics
|
|
98804
|
+
configFileParsingDiagnostics,
|
|
98805
|
+
typeScriptVersion: typeScriptVersion2
|
|
98710
98806
|
};
|
|
98711
98807
|
}
|
|
98712
98808
|
function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
|
|
98713
98809
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
98714
98810
|
const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
|
|
98715
|
-
const { rootNames, options, configFileParsingDiagnostics, projectReferences } = createProgramOptions;
|
|
98811
|
+
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion2 } = createProgramOptions;
|
|
98716
98812
|
let { oldProgram } = createProgramOptions;
|
|
98717
98813
|
let processingDefaultLibFiles;
|
|
98718
98814
|
let processingOtherFiles;
|
|
@@ -100471,7 +100567,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
100471
100567
|
i++;
|
|
100472
100568
|
}
|
|
100473
100569
|
const resolveFrom = combinePaths(currentDirectory, `__lib_node_modules_lookup_${libFileName}__.ts`);
|
|
100474
|
-
const localOverrideModuleResult = resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: 2 /*
|
|
100570
|
+
const localOverrideModuleResult = resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: 2 /* Node10 */ }, host, moduleResolutionCache);
|
|
100475
100571
|
if (localOverrideModuleResult == null ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
100476
100572
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
100477
100573
|
}
|
|
@@ -100644,6 +100740,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
100644
100740
|
} else if (options.incremental && !outputFile && !options.configFilePath) {
|
|
100645
100741
|
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
|
|
100646
100742
|
}
|
|
100743
|
+
verifyDeprecatedCompilerOptions();
|
|
100647
100744
|
verifyProjectReferences();
|
|
100648
100745
|
if (options.composite) {
|
|
100649
100746
|
const rootPaths = new Set(rootNames.map(toPath3));
|
|
@@ -100754,8 +100851,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
100754
100851
|
}
|
|
100755
100852
|
}
|
|
100756
100853
|
if (getResolveJsonModule(options)) {
|
|
100757
|
-
if (getEmitModuleResolutionKind(options)
|
|
100758
|
-
createDiagnosticForOptionName(Diagnostics.
|
|
100854
|
+
if (getEmitModuleResolutionKind(options) === 1 /* Classic */) {
|
|
100855
|
+
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_when_moduleResolution_is_set_to_classic, "resolveJsonModule");
|
|
100759
100856
|
} else if (!hasJsonModuleEmitEnabled(options)) {
|
|
100760
100857
|
createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext, "resolveJsonModule", "module");
|
|
100761
100858
|
}
|
|
@@ -100863,6 +100960,56 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
100863
100960
|
}
|
|
100864
100961
|
}
|
|
100865
100962
|
}
|
|
100963
|
+
function verifyDeprecatedCompilerOptions() {
|
|
100964
|
+
const version2 = typeScriptVersion2 || versionMajorMinor;
|
|
100965
|
+
const ignoreDeprecations = options.ignoreDeprecations;
|
|
100966
|
+
if (ignoreDeprecations) {
|
|
100967
|
+
if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) {
|
|
100968
|
+
return;
|
|
100969
|
+
} else {
|
|
100970
|
+
createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations);
|
|
100971
|
+
}
|
|
100972
|
+
}
|
|
100973
|
+
if (options.target === 0 /* ES3 */) {
|
|
100974
|
+
createDeprecatedDiagnosticForOption(version2, "target", "ES3");
|
|
100975
|
+
}
|
|
100976
|
+
if (options.noImplicitUseStrict) {
|
|
100977
|
+
createDeprecatedDiagnosticForOption(version2, "noImplicitUseStrict");
|
|
100978
|
+
}
|
|
100979
|
+
if (options.keyofStringsOnly) {
|
|
100980
|
+
createDeprecatedDiagnosticForOption(version2, "keyofStringsOnly");
|
|
100981
|
+
}
|
|
100982
|
+
if (options.suppressExcessPropertyErrors) {
|
|
100983
|
+
createDeprecatedDiagnosticForOption(version2, "suppressExcessPropertyErrors");
|
|
100984
|
+
}
|
|
100985
|
+
if (options.suppressImplicitAnyIndexErrors) {
|
|
100986
|
+
createDeprecatedDiagnosticForOption(version2, "suppressImplicitAnyIndexErrors");
|
|
100987
|
+
}
|
|
100988
|
+
if (options.noStrictGenericChecks) {
|
|
100989
|
+
createDeprecatedDiagnosticForOption(version2, "noStrictGenericChecks");
|
|
100990
|
+
}
|
|
100991
|
+
if (options.charset) {
|
|
100992
|
+
createDeprecatedDiagnosticForOption(version2, "charset");
|
|
100993
|
+
}
|
|
100994
|
+
if (options.out) {
|
|
100995
|
+
createDeprecatedDiagnosticForOption(version2, "out");
|
|
100996
|
+
}
|
|
100997
|
+
}
|
|
100998
|
+
function createDeprecatedDiagnosticForOption(version2, name, value) {
|
|
100999
|
+
if (version2 === "6.0" /* v6_0 */) {
|
|
101000
|
+
createDiagnosticForOption(!value, name, void 0, Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name);
|
|
101001
|
+
} else {
|
|
101002
|
+
createDiagnosticForOption(
|
|
101003
|
+
!value,
|
|
101004
|
+
name,
|
|
101005
|
+
void 0,
|
|
101006
|
+
Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_ignoreDeprecations_Colon_2_to_silence_this_error,
|
|
101007
|
+
value || name,
|
|
101008
|
+
"5.5" /* v5_5 */,
|
|
101009
|
+
"5.0" /* v5_0 */
|
|
101010
|
+
);
|
|
101011
|
+
}
|
|
101012
|
+
}
|
|
100866
101013
|
function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
|
|
100867
101014
|
var _a3;
|
|
100868
101015
|
let fileIncludeReasons;
|