@html-validate/commitlint-config 3.4.2 → 3.4.4
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/dist/commitlint.js +1081 -671
- package/dist/install.js +6 -1
- package/package.json +1 -1
package/dist/commitlint.js
CHANGED
|
@@ -19340,6 +19340,7 @@ var require_typescript = __commonJS({
|
|
|
19340
19340
|
createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
19341
19341
|
createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
19342
19342
|
createProgram: () => createProgram,
|
|
19343
|
+
createProgramDiagnostics: () => createProgramDiagnostics,
|
|
19343
19344
|
createProgramHost: () => createProgramHost,
|
|
19344
19345
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|
|
19345
19346
|
createQueue: () => createQueue,
|
|
@@ -19509,6 +19510,8 @@ var require_typescript = __commonJS({
|
|
|
19509
19510
|
forEachLeadingCommentRange: () => forEachLeadingCommentRange,
|
|
19510
19511
|
forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft,
|
|
19511
19512
|
forEachNameOfDefaultExport: () => forEachNameOfDefaultExport,
|
|
19513
|
+
forEachOptionsSyntaxByName: () => forEachOptionsSyntaxByName,
|
|
19514
|
+
forEachProjectReference: () => forEachProjectReference,
|
|
19512
19515
|
forEachPropertyAssignment: () => forEachPropertyAssignment,
|
|
19513
19516
|
forEachResolvedProjectReference: () => forEachResolvedProjectReference,
|
|
19514
19517
|
forEachReturnStatement: () => forEachReturnStatement,
|
|
@@ -19748,6 +19751,8 @@ var require_typescript = __commonJS({
|
|
|
19748
19751
|
getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode,
|
|
19749
19752
|
getLeftmostAccessExpression: () => getLeftmostAccessExpression,
|
|
19750
19753
|
getLeftmostExpression: () => getLeftmostExpression,
|
|
19754
|
+
getLibFileNameFromLibReference: () => getLibFileNameFromLibReference,
|
|
19755
|
+
getLibNameFromLibReference: () => getLibNameFromLibReference,
|
|
19751
19756
|
getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName,
|
|
19752
19757
|
getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition,
|
|
19753
19758
|
getLineInfo: () => getLineInfo,
|
|
@@ -19820,6 +19825,8 @@ var require_typescript = __commonJS({
|
|
|
19820
19825
|
getOptionFromName: () => getOptionFromName,
|
|
19821
19826
|
getOptionsForLibraryResolution: () => getOptionsForLibraryResolution,
|
|
19822
19827
|
getOptionsNameMap: () => getOptionsNameMap,
|
|
19828
|
+
getOptionsSyntaxByArrayElementValue: () => getOptionsSyntaxByArrayElementValue,
|
|
19829
|
+
getOptionsSyntaxByValue: () => getOptionsSyntaxByValue,
|
|
19823
19830
|
getOrCreateEmitNode: () => getOrCreateEmitNode,
|
|
19824
19831
|
getOrUpdate: () => getOrUpdate,
|
|
19825
19832
|
getOriginalNode: () => getOriginalNode,
|
|
@@ -19856,7 +19863,6 @@ var require_typescript = __commonJS({
|
|
|
19856
19863
|
getPrivateIdentifier: () => getPrivateIdentifier,
|
|
19857
19864
|
getProperties: () => getProperties,
|
|
19858
19865
|
getProperty: () => getProperty,
|
|
19859
|
-
getPropertyArrayElementValue: () => getPropertyArrayElementValue,
|
|
19860
19866
|
getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression,
|
|
19861
19867
|
getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode,
|
|
19862
19868
|
getPropertyNameFromType: () => getPropertyNameFromType,
|
|
@@ -20767,6 +20773,7 @@ var require_typescript = __commonJS({
|
|
|
20767
20773
|
moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
|
|
20768
20774
|
moduleSpecifierToValidIdentifier: () => moduleSpecifierToValidIdentifier,
|
|
20769
20775
|
moduleSpecifiers: () => ts_moduleSpecifiers_exports,
|
|
20776
|
+
moduleSupportsImportAttributes: () => moduleSupportsImportAttributes,
|
|
20770
20777
|
moduleSymbolToValidIdentifier: () => moduleSymbolToValidIdentifier,
|
|
20771
20778
|
moveEmitHelpers: () => moveEmitHelpers,
|
|
20772
20779
|
moveRangeEnd: () => moveRangeEnd,
|
|
@@ -21179,8 +21186,8 @@ var require_typescript = __commonJS({
|
|
|
21179
21186
|
zipWith: () => zipWith
|
|
21180
21187
|
});
|
|
21181
21188
|
module2.exports = __toCommonJS(typescript_exports);
|
|
21182
|
-
var versionMajorMinor = "5.
|
|
21183
|
-
var version = "5.
|
|
21189
|
+
var versionMajorMinor = "5.8";
|
|
21190
|
+
var version = "5.8.3";
|
|
21184
21191
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
21185
21192
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
21186
21193
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -25777,6 +25784,7 @@ ${lanes.join("\n")}
|
|
|
25777
25784
|
ModuleKind3[ModuleKind3["ES2022"] = 7] = "ES2022";
|
|
25778
25785
|
ModuleKind3[ModuleKind3["ESNext"] = 99] = "ESNext";
|
|
25779
25786
|
ModuleKind3[ModuleKind3["Node16"] = 100] = "Node16";
|
|
25787
|
+
ModuleKind3[ModuleKind3["Node18"] = 101] = "Node18";
|
|
25780
25788
|
ModuleKind3[ModuleKind3["NodeNext"] = 199] = "NodeNext";
|
|
25781
25789
|
ModuleKind3[ModuleKind3["Preserve"] = 200] = "Preserve";
|
|
25782
25790
|
return ModuleKind3;
|
|
@@ -26261,8 +26269,9 @@ ${lanes.join("\n")}
|
|
|
26261
26269
|
OuterExpressionKinds2[OuterExpressionKinds2["NonNullAssertions"] = 4] = "NonNullAssertions";
|
|
26262
26270
|
OuterExpressionKinds2[OuterExpressionKinds2["PartiallyEmittedExpressions"] = 8] = "PartiallyEmittedExpressions";
|
|
26263
26271
|
OuterExpressionKinds2[OuterExpressionKinds2["ExpressionsWithTypeArguments"] = 16] = "ExpressionsWithTypeArguments";
|
|
26264
|
-
OuterExpressionKinds2[OuterExpressionKinds2["
|
|
26265
|
-
OuterExpressionKinds2[OuterExpressionKinds2["
|
|
26272
|
+
OuterExpressionKinds2[OuterExpressionKinds2["Satisfies"] = 32] = "Satisfies";
|
|
26273
|
+
OuterExpressionKinds2[OuterExpressionKinds2["Assertions"] = 38] = "Assertions";
|
|
26274
|
+
OuterExpressionKinds2[OuterExpressionKinds2["All"] = 63] = "All";
|
|
26266
26275
|
OuterExpressionKinds2[OuterExpressionKinds2["ExcludeJSDocTypeAssertion"] = -2147483648] = "ExcludeJSDocTypeAssertion";
|
|
26267
26276
|
return OuterExpressionKinds2;
|
|
26268
26277
|
})(OuterExpressionKinds || {});
|
|
@@ -28075,23 +28084,105 @@ ${lanes.join("\n")}
|
|
|
28075
28084
|
function getNormalizedPathComponents(path14, currentDirectory) {
|
|
28076
28085
|
return reducePathComponents(getPathComponents(path14, currentDirectory));
|
|
28077
28086
|
}
|
|
28078
|
-
function getNormalizedAbsolutePath(
|
|
28079
|
-
|
|
28087
|
+
function getNormalizedAbsolutePath(path14, currentDirectory) {
|
|
28088
|
+
let rootLength = getRootLength(path14);
|
|
28089
|
+
if (rootLength === 0 && currentDirectory) {
|
|
28090
|
+
path14 = combinePaths(currentDirectory, path14);
|
|
28091
|
+
rootLength = getRootLength(path14);
|
|
28092
|
+
} else {
|
|
28093
|
+
path14 = normalizeSlashes(path14);
|
|
28094
|
+
}
|
|
28095
|
+
const simpleNormalized = simpleNormalizePath(path14);
|
|
28096
|
+
if (simpleNormalized !== void 0) {
|
|
28097
|
+
return simpleNormalized.length > rootLength ? removeTrailingDirectorySeparator(simpleNormalized) : simpleNormalized;
|
|
28098
|
+
}
|
|
28099
|
+
const length2 = path14.length;
|
|
28100
|
+
const root = path14.substring(0, rootLength);
|
|
28101
|
+
let normalized;
|
|
28102
|
+
let index = rootLength;
|
|
28103
|
+
let segmentStart = index;
|
|
28104
|
+
let normalizedUpTo = index;
|
|
28105
|
+
let seenNonDotDotSegment = rootLength !== 0;
|
|
28106
|
+
while (index < length2) {
|
|
28107
|
+
segmentStart = index;
|
|
28108
|
+
let ch = path14.charCodeAt(index);
|
|
28109
|
+
while (ch === 47 && index + 1 < length2) {
|
|
28110
|
+
index++;
|
|
28111
|
+
ch = path14.charCodeAt(index);
|
|
28112
|
+
}
|
|
28113
|
+
if (index > segmentStart) {
|
|
28114
|
+
normalized ?? (normalized = path14.substring(0, segmentStart - 1));
|
|
28115
|
+
segmentStart = index;
|
|
28116
|
+
}
|
|
28117
|
+
let segmentEnd = path14.indexOf(directorySeparator, index + 1);
|
|
28118
|
+
if (segmentEnd === -1) {
|
|
28119
|
+
segmentEnd = length2;
|
|
28120
|
+
}
|
|
28121
|
+
const segmentLength = segmentEnd - segmentStart;
|
|
28122
|
+
if (segmentLength === 1 && path14.charCodeAt(index) === 46) {
|
|
28123
|
+
normalized ?? (normalized = path14.substring(0, normalizedUpTo));
|
|
28124
|
+
} else if (segmentLength === 2 && path14.charCodeAt(index) === 46 && path14.charCodeAt(index + 1) === 46) {
|
|
28125
|
+
if (!seenNonDotDotSegment) {
|
|
28126
|
+
if (normalized !== void 0) {
|
|
28127
|
+
normalized += normalized.length === rootLength ? ".." : "/..";
|
|
28128
|
+
} else {
|
|
28129
|
+
normalizedUpTo = index + 2;
|
|
28130
|
+
}
|
|
28131
|
+
} else if (normalized === void 0) {
|
|
28132
|
+
if (normalizedUpTo - 2 >= 0) {
|
|
28133
|
+
normalized = path14.substring(0, Math.max(rootLength, path14.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
|
|
28134
|
+
} else {
|
|
28135
|
+
normalized = path14.substring(0, normalizedUpTo);
|
|
28136
|
+
}
|
|
28137
|
+
} else {
|
|
28138
|
+
const lastSlash = normalized.lastIndexOf(directorySeparator);
|
|
28139
|
+
if (lastSlash !== -1) {
|
|
28140
|
+
normalized = normalized.substring(0, Math.max(rootLength, lastSlash));
|
|
28141
|
+
} else {
|
|
28142
|
+
normalized = root;
|
|
28143
|
+
}
|
|
28144
|
+
if (normalized.length === rootLength) {
|
|
28145
|
+
seenNonDotDotSegment = rootLength !== 0;
|
|
28146
|
+
}
|
|
28147
|
+
}
|
|
28148
|
+
} else if (normalized !== void 0) {
|
|
28149
|
+
if (normalized.length !== rootLength) {
|
|
28150
|
+
normalized += directorySeparator;
|
|
28151
|
+
}
|
|
28152
|
+
seenNonDotDotSegment = true;
|
|
28153
|
+
normalized += path14.substring(segmentStart, segmentEnd);
|
|
28154
|
+
} else {
|
|
28155
|
+
seenNonDotDotSegment = true;
|
|
28156
|
+
normalizedUpTo = segmentEnd;
|
|
28157
|
+
}
|
|
28158
|
+
index = segmentEnd + 1;
|
|
28159
|
+
}
|
|
28160
|
+
return normalized ?? (length2 > rootLength ? removeTrailingDirectorySeparator(path14) : path14);
|
|
28080
28161
|
}
|
|
28081
28162
|
function normalizePath(path14) {
|
|
28082
28163
|
path14 = normalizeSlashes(path14);
|
|
28164
|
+
let normalized = simpleNormalizePath(path14);
|
|
28165
|
+
if (normalized !== void 0) {
|
|
28166
|
+
return normalized;
|
|
28167
|
+
}
|
|
28168
|
+
normalized = getNormalizedAbsolutePath(path14, "");
|
|
28169
|
+
return normalized && hasTrailingDirectorySeparator(path14) ? ensureTrailingDirectorySeparator(normalized) : normalized;
|
|
28170
|
+
}
|
|
28171
|
+
function simpleNormalizePath(path14) {
|
|
28083
28172
|
if (!relativePathSegmentRegExp.test(path14)) {
|
|
28084
28173
|
return path14;
|
|
28085
28174
|
}
|
|
28086
|
-
|
|
28175
|
+
let simplified = path14.replace(/\/\.\//g, "/");
|
|
28176
|
+
if (simplified.startsWith("./")) {
|
|
28177
|
+
simplified = simplified.slice(2);
|
|
28178
|
+
}
|
|
28087
28179
|
if (simplified !== path14) {
|
|
28088
28180
|
path14 = simplified;
|
|
28089
28181
|
if (!relativePathSegmentRegExp.test(path14)) {
|
|
28090
28182
|
return path14;
|
|
28091
28183
|
}
|
|
28092
28184
|
}
|
|
28093
|
-
|
|
28094
|
-
return normalized && hasTrailingDirectorySeparator(path14) ? ensureTrailingDirectorySeparator(normalized) : normalized;
|
|
28185
|
+
return void 0;
|
|
28095
28186
|
}
|
|
28096
28187
|
function getPathWithoutRoot(pathComponents2) {
|
|
28097
28188
|
if (pathComponents2.length === 0) return "";
|
|
@@ -28517,6 +28608,7 @@ ${lanes.join("\n")}
|
|
|
28517
28608
|
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
28518
28609
|
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
28519
28610
|
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
|
|
28611
|
+
This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled: diag(1294, 1, "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294", "This syntax is not allowed when 'erasableSyntaxOnly' is enabled."),
|
|
28520
28612
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
28521
28613
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
28522
28614
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
@@ -28531,8 +28623,8 @@ ${lanes.join("\n")}
|
|
|
28531
28623
|
Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, 1, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),
|
|
28532
28624
|
Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, 1, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),
|
|
28533
28625
|
Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, 1, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),
|
|
28534
|
-
|
|
28535
|
-
|
|
28626
|
+
Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext: diag(1323, 1, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'."),
|
|
28627
|
+
Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve: diag(1324, 1, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'."),
|
|
28536
28628
|
Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, 1, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
|
|
28537
28629
|
This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, 1, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),
|
|
28538
28630
|
String_literal_with_double_quotes_expected: diag(1327, 1, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
|
|
@@ -28549,7 +28641,7 @@ ${lanes.join("\n")}
|
|
|
28549
28641
|
Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
|
|
28550
28642
|
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
|
|
28551
28643
|
Class_constructor_may_not_be_an_accessor: diag(1341, 1, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."),
|
|
28552
|
-
|
|
28644
|
+
The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext: diag(1343, 1, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'."),
|
|
28553
28645
|
A_label_is_not_allowed_here: diag(1344, 1, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
|
|
28554
28646
|
An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
|
|
28555
28647
|
This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, 1, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
|
|
@@ -28579,7 +28671,7 @@ ${lanes.join("\n")}
|
|
|
28579
28671
|
await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
28580
28672
|
_0_was_imported_here: diag(1376, 3, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
28581
28673
|
_0_was_exported_here: diag(1377, 3, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
28582
|
-
|
|
28674
|
+
Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
|
|
28583
28675
|
An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
|
|
28584
28676
|
An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
|
|
28585
28677
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
@@ -28630,7 +28722,7 @@ ${lanes.join("\n")}
|
|
|
28630
28722
|
File_redirects_to_file_0: diag(1429, 3, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
28631
28723
|
The_file_is_in_the_program_because_Colon: diag(1430, 3, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
|
|
28632
28724
|
for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
28633
|
-
|
|
28725
|
+
Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
|
|
28634
28726
|
Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."),
|
|
28635
28727
|
Unexpected_keyword_or_identifier: diag(1434, 1, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
|
|
28636
28728
|
Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
|
|
@@ -29272,9 +29364,9 @@ ${lanes.join("\n")}
|
|
|
29272
29364
|
Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, 1, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),
|
|
29273
29365
|
Namespace_name_cannot_be_0: diag(2819, 1, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
|
|
29274
29366
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
29275
|
-
|
|
29367
|
+
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2821, 1, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."),
|
|
29276
29368
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
29277
|
-
|
|
29369
|
+
Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2823, 1, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."),
|
|
29278
29370
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
29279
29371
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
|
|
29280
29372
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
|
|
@@ -29294,7 +29386,7 @@ ${lanes.join("\n")}
|
|
|
29294
29386
|
The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_Symbol_dispose_method_or_be_null_or_undefined: diag(2851, 1, "The_initializer_of_an_await_using_declaration_must_be_either_an_object_with_a_Symbol_asyncDispose_or_2851", "The initializer of an 'await using' declaration must be either an object with a '[Symbol.asyncDispose]()' or '[Symbol.dispose]()' method, or be 'null' or 'undefined'."),
|
|
29295
29387
|
await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
|
|
29296
29388
|
await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
29297
|
-
|
|
29389
|
+
Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
|
|
29298
29390
|
Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
|
|
29299
29391
|
Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),
|
|
29300
29392
|
Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
|
|
@@ -29320,6 +29412,7 @@ ${lanes.join("\n")}
|
|
|
29320
29412
|
This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path: diag(2877, 1, "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877", "This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),
|
|
29321
29413
|
This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
|
|
29322
29414
|
Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
|
|
29415
|
+
Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),
|
|
29323
29416
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
29324
29417
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
29325
29418
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -29429,6 +29522,8 @@ ${lanes.join("\n")}
|
|
|
29429
29522
|
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
29430
29523
|
Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
|
|
29431
29524
|
One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
|
|
29525
|
+
This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic: diag(4127, 1, "This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127", "This member cannot have an 'override' modifier because its name is dynamic."),
|
|
29526
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic: diag(4128, 1, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128", "This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."),
|
|
29432
29527
|
The_current_host_does_not_support_the_0_option: diag(5001, 1, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
29433
29528
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
29434
29529
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -30001,11 +30096,13 @@ ${lanes.join("\n")}
|
|
|
30001
30096
|
Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
|
|
30002
30097
|
Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
|
|
30003
30098
|
Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any: diag(6720, 3, "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720", "Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),
|
|
30099
|
+
Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript: diag(6721, 3, "Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721", "Do not allow runtime constructs that are not part of ECMAScript."),
|
|
30004
30100
|
Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
|
|
30005
30101
|
Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
|
|
30006
30102
|
Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: diag(6805, 3, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."),
|
|
30007
30103
|
Check_side_effect_imports: diag(6806, 3, "Check_side_effect_imports_6806", "Check side effect imports."),
|
|
30008
30104
|
This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2: diag(6807, 1, "This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807", "This operation can be simplified. This shift is identical to `{0} {1} {2}`."),
|
|
30105
|
+
Enable_lib_replacement: diag(6808, 3, "Enable_lib_replacement_6808", "Enable lib replacement."),
|
|
30009
30106
|
one_of_Colon: diag(6900, 3, "one_of_Colon_6900", "one of:"),
|
|
30010
30107
|
one_or_more_Colon: diag(6901, 3, "one_or_more_Colon_6901", "one or more:"),
|
|
30011
30108
|
type_Colon: diag(6902, 3, "type_Colon_6902", "type:"),
|
|
@@ -36102,6 +36199,9 @@ ${lanes.join("\n")}
|
|
|
36102
36199
|
"trunc",
|
|
36103
36200
|
"fround",
|
|
36104
36201
|
"cbrt"
|
|
36202
|
+
],
|
|
36203
|
+
esnext: [
|
|
36204
|
+
"f16round"
|
|
36105
36205
|
]
|
|
36106
36206
|
})),
|
|
36107
36207
|
Map: new Map(Object.entries({
|
|
@@ -36271,6 +36371,10 @@ ${lanes.join("\n")}
|
|
|
36271
36371
|
"setBigUint64",
|
|
36272
36372
|
"getBigInt64",
|
|
36273
36373
|
"getBigUint64"
|
|
36374
|
+
],
|
|
36375
|
+
esnext: [
|
|
36376
|
+
"setFloat16",
|
|
36377
|
+
"getFloat16"
|
|
36274
36378
|
]
|
|
36275
36379
|
})),
|
|
36276
36380
|
BigInt: new Map(Object.entries({
|
|
@@ -36374,6 +36478,9 @@ ${lanes.join("\n")}
|
|
|
36374
36478
|
"with"
|
|
36375
36479
|
]
|
|
36376
36480
|
})),
|
|
36481
|
+
Float16Array: new Map(Object.entries({
|
|
36482
|
+
esnext: emptyArray
|
|
36483
|
+
})),
|
|
36377
36484
|
Float32Array: new Map(Object.entries({
|
|
36378
36485
|
es2022: [
|
|
36379
36486
|
"at"
|
|
@@ -36565,7 +36672,7 @@ ${lanes.join("\n")}
|
|
|
36565
36672
|
return (_a2 = symbol.declarations) == null ? void 0 : _a2.find((d) => !isExternalModuleAugmentation(d) && !(isModuleDeclaration(d) && isGlobalScopeAugmentation(d)));
|
|
36566
36673
|
}
|
|
36567
36674
|
function isCommonJSContainingModuleKind(kind) {
|
|
36568
|
-
return kind === 1 ||
|
|
36675
|
+
return kind === 1 || 100 <= kind && kind <= 199;
|
|
36569
36676
|
}
|
|
36570
36677
|
function isEffectiveExternalModule(node, compilerOptions) {
|
|
36571
36678
|
return isExternalModule(node) || isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator;
|
|
@@ -37287,9 +37394,6 @@ ${lanes.join("\n")}
|
|
|
37287
37394
|
return key === propName || key2 && key2 === propName ? callback(property) : void 0;
|
|
37288
37395
|
});
|
|
37289
37396
|
}
|
|
37290
|
-
function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {
|
|
37291
|
-
return forEachPropertyAssignment(objectLiteral, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0);
|
|
37292
|
-
}
|
|
37293
37397
|
function getTsConfigObjectLiteralExpression(tsConfigSourceFile) {
|
|
37294
37398
|
if (tsConfigSourceFile && tsConfigSourceFile.statements.length) {
|
|
37295
37399
|
const expression = tsConfigSourceFile.statements[0].expression;
|
|
@@ -41245,7 +41349,7 @@ ${lanes.join("\n")}
|
|
|
41245
41349
|
dependencies: ["module"],
|
|
41246
41350
|
computeValue: (compilerOptions) => {
|
|
41247
41351
|
const target = compilerOptions.target === 0 ? void 0 : compilerOptions.target;
|
|
41248
|
-
return target ?? (compilerOptions.module === 100 && 9 || compilerOptions.module === 199 && 99 || 1);
|
|
41352
|
+
return target ?? (compilerOptions.module === 100 && 9 || compilerOptions.module === 101 && 9 || compilerOptions.module === 199 && 99 || 1);
|
|
41249
41353
|
}
|
|
41250
41354
|
},
|
|
41251
41355
|
module: {
|
|
@@ -41264,6 +41368,7 @@ ${lanes.join("\n")}
|
|
|
41264
41368
|
moduleResolution = 2;
|
|
41265
41369
|
break;
|
|
41266
41370
|
case 100:
|
|
41371
|
+
case 101:
|
|
41267
41372
|
moduleResolution = 3;
|
|
41268
41373
|
break;
|
|
41269
41374
|
case 199:
|
|
@@ -41283,7 +41388,11 @@ ${lanes.join("\n")}
|
|
|
41283
41388
|
moduleDetection: {
|
|
41284
41389
|
dependencies: ["module", "target"],
|
|
41285
41390
|
computeValue: (compilerOptions) => {
|
|
41286
|
-
|
|
41391
|
+
if (compilerOptions.moduleDetection !== void 0) {
|
|
41392
|
+
return compilerOptions.moduleDetection;
|
|
41393
|
+
}
|
|
41394
|
+
const moduleKind = _computedOptions.module.computeValue(compilerOptions);
|
|
41395
|
+
return 100 <= moduleKind && moduleKind <= 199 ? 3 : 2;
|
|
41287
41396
|
}
|
|
41288
41397
|
},
|
|
41289
41398
|
isolatedModules: {
|
|
@@ -41300,6 +41409,7 @@ ${lanes.join("\n")}
|
|
|
41300
41409
|
}
|
|
41301
41410
|
switch (_computedOptions.module.computeValue(compilerOptions)) {
|
|
41302
41411
|
case 100:
|
|
41412
|
+
case 101:
|
|
41303
41413
|
case 199:
|
|
41304
41414
|
case 200:
|
|
41305
41415
|
return true;
|
|
@@ -41493,6 +41603,9 @@ ${lanes.join("\n")}
|
|
|
41493
41603
|
function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
|
|
41494
41604
|
return moduleResolution >= 3 && moduleResolution <= 99 || moduleResolution === 100;
|
|
41495
41605
|
}
|
|
41606
|
+
function moduleSupportsImportAttributes(moduleKind) {
|
|
41607
|
+
return 101 <= moduleKind && moduleKind <= 199 || moduleKind === 200 || moduleKind === 99;
|
|
41608
|
+
}
|
|
41496
41609
|
function getStrictOptionValue(compilerOptions, flag) {
|
|
41497
41610
|
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
|
|
41498
41611
|
}
|
|
@@ -42338,7 +42451,7 @@ ${lanes.join("\n")}
|
|
|
42338
42451
|
return success && result === 10 && scanner2.getTokenEnd() === s.length + 1 && !(flags & 512) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner2.getTokenValue()) }));
|
|
42339
42452
|
}
|
|
42340
42453
|
function isValidTypeOnlyAliasUseSite(useSite) {
|
|
42341
|
-
return !!(useSite.flags & 33554432) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
|
|
42454
|
+
return !!(useSite.flags & 33554432) || isInJSDoc(useSite) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
|
|
42342
42455
|
}
|
|
42343
42456
|
function isShorthandPropertyNameUseSite(useSite) {
|
|
42344
42457
|
return isIdentifier(useSite) && isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
|
|
@@ -43559,6 +43672,64 @@ ${lanes.join("\n")}
|
|
|
43559
43672
|
function isNewScopeNode(node) {
|
|
43560
43673
|
return isFunctionLike(node) || isJSDocSignature(node) || isMappedTypeNode(node);
|
|
43561
43674
|
}
|
|
43675
|
+
function getLibNameFromLibReference(libReference) {
|
|
43676
|
+
return toFileNameLowerCase(libReference.fileName);
|
|
43677
|
+
}
|
|
43678
|
+
function getLibFileNameFromLibReference(libReference) {
|
|
43679
|
+
const libName = getLibNameFromLibReference(libReference);
|
|
43680
|
+
return libMap.get(libName);
|
|
43681
|
+
}
|
|
43682
|
+
function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
|
|
43683
|
+
return forEachProjectReference(
|
|
43684
|
+
/*projectReferences*/
|
|
43685
|
+
void 0,
|
|
43686
|
+
resolvedProjectReferences,
|
|
43687
|
+
(resolvedRef, parent2) => resolvedRef && cb(resolvedRef, parent2)
|
|
43688
|
+
);
|
|
43689
|
+
}
|
|
43690
|
+
function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {
|
|
43691
|
+
let seenResolvedRefs;
|
|
43692
|
+
return worker(
|
|
43693
|
+
projectReferences,
|
|
43694
|
+
resolvedProjectReferences,
|
|
43695
|
+
/*parent*/
|
|
43696
|
+
void 0
|
|
43697
|
+
);
|
|
43698
|
+
function worker(projectReferences2, resolvedProjectReferences2, parent2) {
|
|
43699
|
+
if (cbRef) {
|
|
43700
|
+
const result = cbRef(projectReferences2, parent2);
|
|
43701
|
+
if (result) return result;
|
|
43702
|
+
}
|
|
43703
|
+
let skipChildren;
|
|
43704
|
+
return forEach(
|
|
43705
|
+
resolvedProjectReferences2,
|
|
43706
|
+
(resolvedRef, index) => {
|
|
43707
|
+
if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {
|
|
43708
|
+
(skipChildren ?? (skipChildren = /* @__PURE__ */ new Set())).add(resolvedRef);
|
|
43709
|
+
return void 0;
|
|
43710
|
+
}
|
|
43711
|
+
const result = cbResolvedRef(resolvedRef, parent2, index);
|
|
43712
|
+
if (result || !resolvedRef) return result;
|
|
43713
|
+
(seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path);
|
|
43714
|
+
}
|
|
43715
|
+
) || forEach(
|
|
43716
|
+
resolvedProjectReferences2,
|
|
43717
|
+
(resolvedRef) => resolvedRef && !(skipChildren == null ? void 0 : skipChildren.has(resolvedRef)) ? worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : void 0
|
|
43718
|
+
);
|
|
43719
|
+
}
|
|
43720
|
+
}
|
|
43721
|
+
function getOptionsSyntaxByArrayElementValue(optionsObject, name, value2) {
|
|
43722
|
+
return optionsObject && getPropertyArrayElementValue(optionsObject, name, value2);
|
|
43723
|
+
}
|
|
43724
|
+
function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {
|
|
43725
|
+
return forEachPropertyAssignment(objectLiteral, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0);
|
|
43726
|
+
}
|
|
43727
|
+
function getOptionsSyntaxByValue(optionsObject, name, value2) {
|
|
43728
|
+
return forEachOptionsSyntaxByName(optionsObject, name, (property) => isStringLiteral(property.initializer) && property.initializer.text === value2 ? property.initializer : void 0);
|
|
43729
|
+
}
|
|
43730
|
+
function forEachOptionsSyntaxByName(optionsObject, name, callback) {
|
|
43731
|
+
return forEachPropertyAssignment(optionsObject, name, callback);
|
|
43732
|
+
}
|
|
43562
43733
|
function createBaseNodeFactory() {
|
|
43563
43734
|
let NodeConstructor2;
|
|
43564
43735
|
let TokenConstructor2;
|
|
@@ -46666,6 +46837,8 @@ ${lanes.join("\n")}
|
|
|
46666
46837
|
);
|
|
46667
46838
|
node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse);
|
|
46668
46839
|
node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse);
|
|
46840
|
+
node.flowNodeWhenFalse = void 0;
|
|
46841
|
+
node.flowNodeWhenTrue = void 0;
|
|
46669
46842
|
return node;
|
|
46670
46843
|
}
|
|
46671
46844
|
function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) {
|
|
@@ -48781,7 +48954,7 @@ ${lanes.join("\n")}
|
|
|
48781
48954
|
function isIgnorableParen(node) {
|
|
48782
48955
|
return isParenthesizedExpression(node) && nodeIsSynthesized(node) && nodeIsSynthesized(getSourceMapRange(node)) && nodeIsSynthesized(getCommentRange(node)) && !some(getSyntheticLeadingComments(node)) && !some(getSyntheticTrailingComments(node));
|
|
48783
48956
|
}
|
|
48784
|
-
function restoreOuterExpressions(outerExpression, innerExpression, kinds =
|
|
48957
|
+
function restoreOuterExpressions(outerExpression, innerExpression, kinds = 63) {
|
|
48785
48958
|
if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) {
|
|
48786
48959
|
return updateOuterExpression(
|
|
48787
48960
|
outerExpression,
|
|
@@ -48829,7 +49002,7 @@ ${lanes.join("\n")}
|
|
|
48829
49002
|
function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers = false) {
|
|
48830
49003
|
const callee = skipOuterExpressions(
|
|
48831
49004
|
expression,
|
|
48832
|
-
|
|
49005
|
+
63
|
|
48833
49006
|
/* All */
|
|
48834
49007
|
);
|
|
48835
49008
|
let thisArg;
|
|
@@ -51864,7 +52037,7 @@ ${lanes.join("\n")}
|
|
|
51864
52037
|
Debug.assertIsDefined(type);
|
|
51865
52038
|
return type;
|
|
51866
52039
|
}
|
|
51867
|
-
function isOuterExpression(node, kinds =
|
|
52040
|
+
function isOuterExpression(node, kinds = 63) {
|
|
51868
52041
|
switch (node.kind) {
|
|
51869
52042
|
case 217:
|
|
51870
52043
|
if (kinds & -2147483648 && isJSDocTypeAssertion(node)) {
|
|
@@ -51873,8 +52046,9 @@ ${lanes.join("\n")}
|
|
|
51873
52046
|
return (kinds & 1) !== 0;
|
|
51874
52047
|
case 216:
|
|
51875
52048
|
case 234:
|
|
51876
|
-
case 238:
|
|
51877
52049
|
return (kinds & 2) !== 0;
|
|
52050
|
+
case 238:
|
|
52051
|
+
return (kinds & (2 | 32)) !== 0;
|
|
51878
52052
|
case 233:
|
|
51879
52053
|
return (kinds & 16) !== 0;
|
|
51880
52054
|
case 235:
|
|
@@ -51884,13 +52058,13 @@ ${lanes.join("\n")}
|
|
|
51884
52058
|
}
|
|
51885
52059
|
return false;
|
|
51886
52060
|
}
|
|
51887
|
-
function skipOuterExpressions(node, kinds =
|
|
52061
|
+
function skipOuterExpressions(node, kinds = 63) {
|
|
51888
52062
|
while (isOuterExpression(node, kinds)) {
|
|
51889
52063
|
node = node.expression;
|
|
51890
52064
|
}
|
|
51891
52065
|
return node;
|
|
51892
52066
|
}
|
|
51893
|
-
function walkUpOuterExpressions(node, kinds =
|
|
52067
|
+
function walkUpOuterExpressions(node, kinds = 63) {
|
|
51894
52068
|
let parent2 = node.parent;
|
|
51895
52069
|
while (isOuterExpression(parent2, kinds)) {
|
|
51896
52070
|
parent2 = parent2.parent;
|
|
@@ -61256,6 +61430,7 @@ ${lanes.join("\n")}
|
|
|
61256
61430
|
const node = factory2.createExpressionWithTypeArguments(expression, typeArguments);
|
|
61257
61431
|
const res = finishNode(node, pos);
|
|
61258
61432
|
if (usedBrace) {
|
|
61433
|
+
skipWhitespace();
|
|
61259
61434
|
parseExpected(
|
|
61260
61435
|
20
|
|
61261
61436
|
/* CloseBraceToken */
|
|
@@ -62352,6 +62527,8 @@ ${lanes.join("\n")}
|
|
|
62352
62527
|
["esnext.regexp", "lib.es2024.regexp.d.ts"],
|
|
62353
62528
|
["esnext.string", "lib.es2024.string.d.ts"],
|
|
62354
62529
|
["esnext.iterator", "lib.esnext.iterator.d.ts"],
|
|
62530
|
+
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
62531
|
+
["esnext.float16", "lib.esnext.float16.d.ts"],
|
|
62355
62532
|
["decorators", "lib.decorators.d.ts"],
|
|
62356
62533
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
62357
62534
|
];
|
|
@@ -62686,6 +62863,7 @@ ${lanes.join("\n")}
|
|
|
62686
62863
|
es2022: 7,
|
|
62687
62864
|
esnext: 99,
|
|
62688
62865
|
node16: 100,
|
|
62866
|
+
node18: 101,
|
|
62689
62867
|
nodenext: 199,
|
|
62690
62868
|
preserve: 200
|
|
62691
62869
|
/* Preserve */
|
|
@@ -62941,6 +63119,23 @@ ${lanes.join("\n")}
|
|
|
62941
63119
|
affectsBuildInfo: true,
|
|
62942
63120
|
affectsSemanticDiagnostics: true
|
|
62943
63121
|
},
|
|
63122
|
+
{
|
|
63123
|
+
name: "erasableSyntaxOnly",
|
|
63124
|
+
type: "boolean",
|
|
63125
|
+
category: Diagnostics.Interop_Constraints,
|
|
63126
|
+
description: Diagnostics.Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript,
|
|
63127
|
+
defaultValueDescription: false,
|
|
63128
|
+
affectsBuildInfo: true,
|
|
63129
|
+
affectsSemanticDiagnostics: true
|
|
63130
|
+
},
|
|
63131
|
+
{
|
|
63132
|
+
name: "libReplacement",
|
|
63133
|
+
type: "boolean",
|
|
63134
|
+
affectsProgramStructure: true,
|
|
63135
|
+
category: Diagnostics.Language_and_Environment,
|
|
63136
|
+
description: Diagnostics.Enable_lib_replacement,
|
|
63137
|
+
defaultValueDescription: true
|
|
63138
|
+
},
|
|
62944
63139
|
// Strict Type Checks
|
|
62945
63140
|
{
|
|
62946
63141
|
name: "strict",
|
|
@@ -67220,9 +67415,7 @@ ${lanes.join("\n")}
|
|
|
67220
67415
|
}
|
|
67221
67416
|
function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson = true) {
|
|
67222
67417
|
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
|
|
67223
|
-
|
|
67224
|
-
const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
|
|
67225
|
-
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
|
|
67418
|
+
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo), state);
|
|
67226
67419
|
}
|
|
67227
67420
|
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache2, resolveJs) {
|
|
67228
67421
|
if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) {
|
|
@@ -67240,8 +67433,7 @@ ${lanes.join("\n")}
|
|
|
67240
67433
|
/*onlyRecordFailures*/
|
|
67241
67434
|
false,
|
|
67242
67435
|
loadPackageJsonMainState,
|
|
67243
|
-
packageJsonInfo
|
|
67244
|
-
getVersionPathsOfPackageJsonInfo(packageJsonInfo, loadPackageJsonMainState)
|
|
67436
|
+
packageJsonInfo
|
|
67245
67437
|
);
|
|
67246
67438
|
entrypoints = append(entrypoints, mainResolution == null ? void 0 : mainResolution.path);
|
|
67247
67439
|
if (features & 8 && packageJsonInfo.contents.packageJsonContent.exports) {
|
|
@@ -67452,13 +67644,14 @@ ${lanes.join("\n")}
|
|
|
67452
67644
|
(_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath);
|
|
67453
67645
|
}
|
|
67454
67646
|
}
|
|
67455
|
-
function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state,
|
|
67647
|
+
function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJson) {
|
|
67648
|
+
const versionPaths = packageJson && getVersionPathsOfPackageJsonInfo(packageJson, state);
|
|
67456
67649
|
let packageFile;
|
|
67457
|
-
if (
|
|
67650
|
+
if (packageJson && arePathsEqual(packageJson == null ? void 0 : packageJson.packageDirectory, candidate, state.host)) {
|
|
67458
67651
|
if (state.isConfigLookup) {
|
|
67459
|
-
packageFile = readPackageJsonTSConfigField(
|
|
67652
|
+
packageFile = readPackageJsonTSConfigField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state);
|
|
67460
67653
|
} else {
|
|
67461
|
-
packageFile = extensions & 4 && readPackageJsonTypesFields(
|
|
67654
|
+
packageFile = extensions & 4 && readPackageJsonTypesFields(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || extensions & (3 | 4) && readPackageJsonMainField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || void 0;
|
|
67462
67655
|
}
|
|
67463
67656
|
}
|
|
67464
67657
|
const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
|
|
@@ -67477,7 +67670,7 @@ ${lanes.join("\n")}
|
|
|
67477
67670
|
const features = state2.features;
|
|
67478
67671
|
const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
|
|
67479
67672
|
state2.candidateIsFromPackageJsonField = true;
|
|
67480
|
-
if ((
|
|
67673
|
+
if ((packageJson == null ? void 0 : packageJson.contents.packageJsonContent.type) !== "module") {
|
|
67481
67674
|
state2.features &= ~32;
|
|
67482
67675
|
}
|
|
67483
67676
|
const result = nodeLoadModuleByRelativeName(
|
|
@@ -67748,6 +67941,7 @@ ${lanes.join("\n")}
|
|
|
67748
67941
|
function getLoadModuleFromTargetExportOrImport(extensions, state, cache2, redirectedReference, moduleName2, scope, isImports) {
|
|
67749
67942
|
return loadModuleFromTargetExportOrImport;
|
|
67750
67943
|
function loadModuleFromTargetExportOrImport(target, subpath, pattern, key) {
|
|
67944
|
+
var _a2, _b2;
|
|
67751
67945
|
if (typeof target === "string") {
|
|
67752
67946
|
if (!pattern && subpath.length > 0 && !endsWith(target, "/")) {
|
|
67753
67947
|
if (state.traceEnabled) {
|
|
@@ -67776,6 +67970,8 @@ ${lanes.join("\n")}
|
|
|
67776
67970
|
redirectedReference,
|
|
67777
67971
|
state.conditions
|
|
67778
67972
|
);
|
|
67973
|
+
(_a2 = state.failedLookupLocations) == null ? void 0 : _a2.push(...result.failedLookupLocations ?? emptyArray);
|
|
67974
|
+
(_b2 = state.affectingLocations) == null ? void 0 : _b2.push(...result.affectingLocations ?? emptyArray);
|
|
67779
67975
|
return toSearchResult(
|
|
67780
67976
|
result.resolvedModule ? {
|
|
67781
67977
|
path: result.resolvedModule.resolvedFileName,
|
|
@@ -67885,20 +68081,20 @@ ${lanes.join("\n")}
|
|
|
67885
68081
|
void 0
|
|
67886
68082
|
);
|
|
67887
68083
|
function toAbsolutePath(path14) {
|
|
67888
|
-
var
|
|
68084
|
+
var _a22, _b22;
|
|
67889
68085
|
if (path14 === void 0) return path14;
|
|
67890
|
-
return getNormalizedAbsolutePath(path14, (
|
|
68086
|
+
return getNormalizedAbsolutePath(path14, (_b22 = (_a22 = state.host).getCurrentDirectory) == null ? void 0 : _b22.call(_a22));
|
|
67891
68087
|
}
|
|
67892
68088
|
function combineDirectoryPath(root, dir) {
|
|
67893
68089
|
return ensureTrailingDirectorySeparator(combinePaths(root, dir));
|
|
67894
68090
|
}
|
|
67895
68091
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
67896
|
-
var
|
|
68092
|
+
var _a22, _b22, _c2, _d;
|
|
67897
68093
|
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
|
|
67898
68094
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
67899
68095
|
const commonSourceDirGuesses = [];
|
|
67900
68096
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
67901
|
-
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((
|
|
68097
|
+
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b22 = (_a22 = state.host).getCurrentDirectory) == null ? void 0 : _b22.call(_a22)) || "", getCanonicalFileName));
|
|
67902
68098
|
commonSourceDirGuesses.push(commonDir);
|
|
67903
68099
|
} else if (state.requestContainingDirectory) {
|
|
67904
68100
|
const requestingFile = toAbsolutePath(combinePaths(state.requestContainingDirectory, "index.ts"));
|
|
@@ -67963,8 +68159,8 @@ ${lanes.join("\n")}
|
|
|
67963
68159
|
}
|
|
67964
68160
|
return void 0;
|
|
67965
68161
|
function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) {
|
|
67966
|
-
var
|
|
67967
|
-
const currentDir = state.compilerOptions.configFile ? ((
|
|
68162
|
+
var _a3, _b3;
|
|
68163
|
+
const currentDir = state.compilerOptions.configFile ? ((_b3 = (_a3 = state.host).getCurrentDirectory) == null ? void 0 : _b3.call(_a3)) || "" : commonSourceDirGuess;
|
|
67968
68164
|
const candidateDirectories = [];
|
|
67969
68165
|
if (state.compilerOptions.declarationDir) {
|
|
67970
68166
|
candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir)));
|
|
@@ -68011,7 +68207,7 @@ ${lanes.join("\n")}
|
|
|
68011
68207
|
);
|
|
68012
68208
|
}
|
|
68013
68209
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName2, directory, state, typesScopeOnly, cache2, redirectedReference) {
|
|
68014
|
-
const mode = state.features === 0 ? void 0 : state.features & 32 ? 99 : 1;
|
|
68210
|
+
const mode = state.features === 0 ? void 0 : state.features & 32 || state.conditions.includes("import") ? 99 : 1;
|
|
68015
68211
|
const priorityExtensions = extensions & (1 | 4);
|
|
68016
68212
|
const secondaryExtensions = extensions & ~(1 | 4);
|
|
68017
68213
|
if (priorityExtensions) {
|
|
@@ -68089,8 +68285,7 @@ ${lanes.join("\n")}
|
|
|
68089
68285
|
candidate,
|
|
68090
68286
|
!nodeModulesDirectoryExists,
|
|
68091
68287
|
state,
|
|
68092
|
-
packageInfo
|
|
68093
|
-
getVersionPathsOfPackageJsonInfo(packageInfo, state)
|
|
68288
|
+
packageInfo
|
|
68094
68289
|
);
|
|
68095
68290
|
return withPackageId(packageInfo, fromDirectory, state);
|
|
68096
68291
|
}
|
|
@@ -68100,10 +68295,9 @@ ${lanes.join("\n")}
|
|
|
68100
68295
|
candidate2,
|
|
68101
68296
|
onlyRecordFailures,
|
|
68102
68297
|
state2,
|
|
68103
|
-
packageInfo
|
|
68104
|
-
packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state2)
|
|
68298
|
+
packageInfo
|
|
68105
68299
|
);
|
|
68106
|
-
if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32) {
|
|
68300
|
+
if (!pathAndExtension && !rest && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32) {
|
|
68107
68301
|
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
|
|
68108
68302
|
}
|
|
68109
68303
|
return withPackageId(packageInfo, pathAndExtension, state2);
|
|
@@ -68554,6 +68748,7 @@ ${lanes.join("\n")}
|
|
|
68554
68748
|
var preSwitchCaseFlow;
|
|
68555
68749
|
var activeLabelList;
|
|
68556
68750
|
var hasExplicitReturn;
|
|
68751
|
+
var inReturnPosition;
|
|
68557
68752
|
var hasFlowEffects;
|
|
68558
68753
|
var emitFlags;
|
|
68559
68754
|
var inStrictMode;
|
|
@@ -68626,6 +68821,7 @@ ${lanes.join("\n")}
|
|
|
68626
68821
|
currentExceptionTarget = void 0;
|
|
68627
68822
|
activeLabelList = void 0;
|
|
68628
68823
|
hasExplicitReturn = false;
|
|
68824
|
+
inReturnPosition = false;
|
|
68629
68825
|
hasFlowEffects = false;
|
|
68630
68826
|
inAssignmentPattern = false;
|
|
68631
68827
|
emitFlags = 0;
|
|
@@ -68878,6 +69074,8 @@ ${lanes.join("\n")}
|
|
|
68878
69074
|
const saveContainer = container;
|
|
68879
69075
|
const saveThisParentContainer = thisParentContainer;
|
|
68880
69076
|
const savedBlockScopeContainer = blockScopeContainer;
|
|
69077
|
+
const savedInReturnPosition = inReturnPosition;
|
|
69078
|
+
if (node.kind === 219 && node.body.kind !== 241) inReturnPosition = true;
|
|
68881
69079
|
if (containerFlags & 1) {
|
|
68882
69080
|
if (node.kind !== 219) {
|
|
68883
69081
|
thisParentContainer = container;
|
|
@@ -68959,6 +69157,7 @@ ${lanes.join("\n")}
|
|
|
68959
69157
|
} else {
|
|
68960
69158
|
bindChildren(node);
|
|
68961
69159
|
}
|
|
69160
|
+
inReturnPosition = savedInReturnPosition;
|
|
68962
69161
|
container = saveContainer;
|
|
68963
69162
|
thisParentContainer = saveThisParentContainer;
|
|
68964
69163
|
blockScopeContainer = savedBlockScopeContainer;
|
|
@@ -68980,6 +69179,9 @@ ${lanes.join("\n")}
|
|
|
68980
69179
|
const saveInAssignmentPattern = inAssignmentPattern;
|
|
68981
69180
|
inAssignmentPattern = false;
|
|
68982
69181
|
if (checkUnreachable(node)) {
|
|
69182
|
+
if (canHaveFlowNode(node) && node.flowNode) {
|
|
69183
|
+
node.flowNode = void 0;
|
|
69184
|
+
}
|
|
68983
69185
|
bindEachChild(node);
|
|
68984
69186
|
bindJSDoc(node);
|
|
68985
69187
|
inAssignmentPattern = saveInAssignmentPattern;
|
|
@@ -69175,7 +69377,9 @@ ${lanes.join("\n")}
|
|
|
69175
69377
|
case 36:
|
|
69176
69378
|
case 37:
|
|
69177
69379
|
case 38:
|
|
69178
|
-
|
|
69380
|
+
const left2 = skipParentheses(expr.left);
|
|
69381
|
+
const right2 = skipParentheses(expr.right);
|
|
69382
|
+
return isNarrowableOperand(left2) || isNarrowableOperand(right2) || isNarrowingTypeofOperands(right2, left2) || isNarrowingTypeofOperands(left2, right2) || (isBooleanLiteral(right2) && isNarrowingExpression(left2) || isBooleanLiteral(left2) && isNarrowingExpression(right2));
|
|
69179
69383
|
case 104:
|
|
69180
69384
|
return isNarrowableOperand(expr.left);
|
|
69181
69385
|
case 103:
|
|
@@ -69367,13 +69571,16 @@ ${lanes.join("\n")}
|
|
|
69367
69571
|
function bindForStatement(node) {
|
|
69368
69572
|
const preLoopLabel = setContinueTarget(node, createLoopLabel());
|
|
69369
69573
|
const preBodyLabel = createBranchLabel();
|
|
69574
|
+
const preIncrementorLabel = createBranchLabel();
|
|
69370
69575
|
const postLoopLabel = createBranchLabel();
|
|
69371
69576
|
bind(node.initializer);
|
|
69372
69577
|
addAntecedent(preLoopLabel, currentFlow);
|
|
69373
69578
|
currentFlow = preLoopLabel;
|
|
69374
69579
|
bindCondition(node.condition, preBodyLabel, postLoopLabel);
|
|
69375
69580
|
currentFlow = finishFlowLabel(preBodyLabel);
|
|
69376
|
-
bindIterativeStatement(node.statement, postLoopLabel,
|
|
69581
|
+
bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
|
|
69582
|
+
addAntecedent(preIncrementorLabel, currentFlow);
|
|
69583
|
+
currentFlow = finishFlowLabel(preIncrementorLabel);
|
|
69377
69584
|
bind(node.incrementor);
|
|
69378
69585
|
addAntecedent(preLoopLabel, currentFlow);
|
|
69379
69586
|
currentFlow = finishFlowLabel(postLoopLabel);
|
|
@@ -69410,7 +69617,10 @@ ${lanes.join("\n")}
|
|
|
69410
69617
|
currentFlow = finishFlowLabel(postIfLabel);
|
|
69411
69618
|
}
|
|
69412
69619
|
function bindReturnOrThrow(node) {
|
|
69620
|
+
const savedInReturnPosition = inReturnPosition;
|
|
69621
|
+
inReturnPosition = true;
|
|
69413
69622
|
bind(node.expression);
|
|
69623
|
+
inReturnPosition = savedInReturnPosition;
|
|
69414
69624
|
if (node.kind === 253) {
|
|
69415
69625
|
hasExplicitReturn = true;
|
|
69416
69626
|
if (currentReturnTarget) {
|
|
@@ -69775,10 +69985,16 @@ ${lanes.join("\n")}
|
|
|
69775
69985
|
hasFlowEffects = false;
|
|
69776
69986
|
bindCondition(node.condition, trueLabel, falseLabel);
|
|
69777
69987
|
currentFlow = finishFlowLabel(trueLabel);
|
|
69988
|
+
if (inReturnPosition) {
|
|
69989
|
+
node.flowNodeWhenTrue = currentFlow;
|
|
69990
|
+
}
|
|
69778
69991
|
bind(node.questionToken);
|
|
69779
69992
|
bind(node.whenTrue);
|
|
69780
69993
|
addAntecedent(postExpressionLabel, currentFlow);
|
|
69781
69994
|
currentFlow = finishFlowLabel(falseLabel);
|
|
69995
|
+
if (inReturnPosition) {
|
|
69996
|
+
node.flowNodeWhenFalse = currentFlow;
|
|
69997
|
+
}
|
|
69782
69998
|
bind(node.colonToken);
|
|
69783
69999
|
bind(node.whenFalse);
|
|
69784
70000
|
addAntecedent(postExpressionLabel, currentFlow);
|
|
@@ -73502,6 +73718,7 @@ ${lanes.join("\n")}
|
|
|
73502
73718
|
getNumberLiteralType,
|
|
73503
73719
|
getBigIntType: () => bigintType,
|
|
73504
73720
|
getBigIntLiteralType,
|
|
73721
|
+
getUnknownType: () => unknownType,
|
|
73505
73722
|
createPromiseType,
|
|
73506
73723
|
createArrayType,
|
|
73507
73724
|
getElementTypeOfArrayType,
|
|
@@ -73622,8 +73839,13 @@ ${lanes.join("\n")}
|
|
|
73622
73839
|
getMemberOverrideModifierStatus,
|
|
73623
73840
|
isTypeParameterPossiblyReferenced,
|
|
73624
73841
|
typeHasCallOrConstructSignatures,
|
|
73625
|
-
getSymbolFlags
|
|
73842
|
+
getSymbolFlags,
|
|
73843
|
+
getTypeArgumentsForResolvedSignature
|
|
73626
73844
|
};
|
|
73845
|
+
function getTypeArgumentsForResolvedSignature(signature) {
|
|
73846
|
+
if (signature.mapper === void 0) return void 0;
|
|
73847
|
+
return instantiateTypes((signature.target || signature).typeParameters, signature.mapper);
|
|
73848
|
+
}
|
|
73627
73849
|
function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
|
|
73628
73850
|
const candidatesSet = /* @__PURE__ */ new Set();
|
|
73629
73851
|
const candidates = [];
|
|
@@ -75104,9 +75326,9 @@ ${lanes.join("\n")}
|
|
|
75104
75326
|
const containerKind = grandparent.parent.kind;
|
|
75105
75327
|
if (containerKind === 264 && heritageKind === 96) {
|
|
75106
75328
|
error2(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, unescapeLeadingUnderscores(name));
|
|
75107
|
-
} else if (
|
|
75329
|
+
} else if (isClassLike(grandparent.parent) && heritageKind === 96) {
|
|
75108
75330
|
error2(errorLocation, Diagnostics.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, unescapeLeadingUnderscores(name));
|
|
75109
|
-
} else if (
|
|
75331
|
+
} else if (isClassLike(grandparent.parent) && heritageKind === 119) {
|
|
75110
75332
|
error2(errorLocation, Diagnostics.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types, unescapeLeadingUnderscores(name));
|
|
75111
75333
|
}
|
|
75112
75334
|
} else {
|
|
@@ -76320,7 +76542,7 @@ ${lanes.join("\n")}
|
|
|
76320
76542
|
moduleReference
|
|
76321
76543
|
);
|
|
76322
76544
|
}
|
|
76323
|
-
if (errorNode && (
|
|
76545
|
+
if (errorNode && (moduleKind === 100 || moduleKind === 101)) {
|
|
76324
76546
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
76325
76547
|
const overrideHost = findAncestor(location, (l2) => isImportTypeNode(l2) || isExportDeclaration(l2) || isImportDeclaration(l2) || isJSDocImportTag(l2));
|
|
76326
76548
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 && !hasResolutionModeOverride(overrideHost)) {
|
|
@@ -77599,10 +77821,11 @@ ${lanes.join("\n")}
|
|
|
77599
77821
|
serializeExistingTypeNode(context, typeNode, addUndefined) {
|
|
77600
77822
|
return serializeExistingTypeNode(context, typeNode, !!addUndefined);
|
|
77601
77823
|
},
|
|
77602
|
-
serializeReturnTypeForSignature(syntacticContext, signatureDeclaration) {
|
|
77824
|
+
serializeReturnTypeForSignature(syntacticContext, signatureDeclaration, symbol) {
|
|
77603
77825
|
const context = syntacticContext;
|
|
77604
77826
|
const signature = getSignatureFromDeclaration(signatureDeclaration);
|
|
77605
|
-
|
|
77827
|
+
symbol ?? (symbol = getSymbolOfDeclaration(signatureDeclaration));
|
|
77828
|
+
const returnType = context.enclosingSymbolTypes.get(getSymbolId(symbol)) ?? instantiateType(getReturnTypeOfSignature(signature), context.mapper);
|
|
77606
77829
|
return serializeInferredReturnTypeForSignature(context, signature, returnType);
|
|
77607
77830
|
},
|
|
77608
77831
|
serializeTypeOfExpression(syntacticContext, expr) {
|
|
@@ -77616,7 +77839,7 @@ ${lanes.join("\n")}
|
|
|
77616
77839
|
symbol ?? (symbol = getSymbolOfDeclaration(declaration));
|
|
77617
77840
|
let type = (_a2 = context.enclosingSymbolTypes) == null ? void 0 : _a2.get(getSymbolId(symbol));
|
|
77618
77841
|
if (type === void 0) {
|
|
77619
|
-
type = symbol && !(symbol.flags & (2048 | 131072)) ? instantiateType(getWidenedLiteralType(getTypeOfSymbol(symbol)), context.mapper) : errorType;
|
|
77842
|
+
type = symbol.flags & 98304 && declaration.kind === 178 ? instantiateType(getWriteTypeOfSymbol(symbol), context.mapper) : symbol && !(symbol.flags & (2048 | 131072)) ? instantiateType(getWidenedLiteralType(getTypeOfSymbol(symbol)), context.mapper) : errorType;
|
|
77620
77843
|
}
|
|
77621
77844
|
const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration);
|
|
77622
77845
|
if (addUndefinedForParameter) {
|
|
@@ -77656,12 +77879,7 @@ ${lanes.join("\n")}
|
|
|
77656
77879
|
enterNewScope(context, node) {
|
|
77657
77880
|
if (isFunctionLike(node) || isJSDocSignature(node)) {
|
|
77658
77881
|
const signature = getSignatureFromDeclaration(node);
|
|
77659
|
-
|
|
77660
|
-
signature,
|
|
77661
|
-
/*skipUnionExpanding*/
|
|
77662
|
-
true
|
|
77663
|
-
)[0];
|
|
77664
|
-
return enterNewScope(context, node, expandedParams, signature.typeParameters);
|
|
77882
|
+
return enterNewScope(context, node, signature.parameters, signature.typeParameters);
|
|
77665
77883
|
} else {
|
|
77666
77884
|
const typeParameters = isConditionalTypeNode(node) ? getInferTypeParameters(node) : [getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))];
|
|
77667
77885
|
return enterNewScope(
|
|
@@ -77686,6 +77904,7 @@ ${lanes.join("\n")}
|
|
|
77686
77904
|
const context = syntacticContext;
|
|
77687
77905
|
if (context.bundled || context.enclosingFile !== getSourceFileOfNode(lit)) {
|
|
77688
77906
|
let name = lit.text;
|
|
77907
|
+
const originalName = name;
|
|
77689
77908
|
const nodeSymbol = getNodeLinks(parent2).resolvedSymbol;
|
|
77690
77909
|
const meaning = parent2.isTypeOf ? 111551 : 788968;
|
|
77691
77910
|
const parentSymbol = nodeSymbol && isSymbolAccessible(
|
|
@@ -77715,7 +77934,9 @@ ${lanes.join("\n")}
|
|
|
77715
77934
|
context.tracker.reportLikelyUnsafeImportRequiredError(name);
|
|
77716
77935
|
}
|
|
77717
77936
|
}
|
|
77718
|
-
|
|
77937
|
+
if (name !== originalName) {
|
|
77938
|
+
return name;
|
|
77939
|
+
}
|
|
77719
77940
|
}
|
|
77720
77941
|
},
|
|
77721
77942
|
canReuseTypeNode(context, typeNode) {
|
|
@@ -78405,7 +78626,7 @@ ${lanes.join("\n")}
|
|
|
78405
78626
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
78406
78627
|
var _a3;
|
|
78407
78628
|
const isStaticMethodSymbol = !!(symbol.flags & 8192) && // typeof static method
|
|
78408
|
-
some(symbol.declarations, (declaration) => isStatic(declaration));
|
|
78629
|
+
some(symbol.declarations, (declaration) => isStatic(declaration) && !isLateBindableIndexSignature(getNameOfDeclaration(declaration)));
|
|
78409
78630
|
const isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || // is exported function symbol
|
|
78410
78631
|
forEach(
|
|
78411
78632
|
symbol.declarations,
|
|
@@ -78734,6 +78955,44 @@ ${lanes.join("\n")}
|
|
|
78734
78955
|
ids.unshift(state);
|
|
78735
78956
|
return ids;
|
|
78736
78957
|
}
|
|
78958
|
+
function indexInfoToObjectComputedNamesOrSignatureDeclaration(indexInfo, context2, typeNode) {
|
|
78959
|
+
if (indexInfo.components) {
|
|
78960
|
+
const allComponentComputedNamesSerializable = every(indexInfo.components, (e) => {
|
|
78961
|
+
var _a22;
|
|
78962
|
+
return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && context2.enclosingDeclaration && ((_a22 = isEntityNameVisible(
|
|
78963
|
+
e.name.expression,
|
|
78964
|
+
context2.enclosingDeclaration,
|
|
78965
|
+
/*shouldComputeAliasToMakeVisible*/
|
|
78966
|
+
false
|
|
78967
|
+
)) == null ? void 0 : _a22.accessibility) === 0);
|
|
78968
|
+
});
|
|
78969
|
+
if (allComponentComputedNamesSerializable) {
|
|
78970
|
+
const newComponents = filter(indexInfo.components, (e) => {
|
|
78971
|
+
return !hasLateBindableName(e);
|
|
78972
|
+
});
|
|
78973
|
+
return map(newComponents, (e) => {
|
|
78974
|
+
trackComputedName(e.name.expression, context2.enclosingDeclaration, context2);
|
|
78975
|
+
return setTextRange2(
|
|
78976
|
+
context2,
|
|
78977
|
+
factory.createPropertySignature(
|
|
78978
|
+
indexInfo.isReadonly ? [factory.createModifier(
|
|
78979
|
+
148
|
|
78980
|
+
/* ReadonlyKeyword */
|
|
78981
|
+
)] : void 0,
|
|
78982
|
+
e.name,
|
|
78983
|
+
(isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(
|
|
78984
|
+
58
|
|
78985
|
+
/* QuestionToken */
|
|
78986
|
+
) : void 0,
|
|
78987
|
+
typeNode || typeToTypeNodeHelper(getTypeOfSymbol(e.symbol), context2)
|
|
78988
|
+
),
|
|
78989
|
+
e
|
|
78990
|
+
);
|
|
78991
|
+
});
|
|
78992
|
+
}
|
|
78993
|
+
}
|
|
78994
|
+
return [indexInfoToIndexSignatureDeclarationHelper(indexInfo, context2, typeNode)];
|
|
78995
|
+
}
|
|
78737
78996
|
function createTypeNodesFromResolvedType(resolvedType) {
|
|
78738
78997
|
if (checkTruncationLength(context)) {
|
|
78739
78998
|
if (context.flags & 1) {
|
|
@@ -78758,7 +79017,7 @@ ${lanes.join("\n")}
|
|
|
78758
79017
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180, context));
|
|
78759
79018
|
}
|
|
78760
79019
|
for (const info of resolvedType.indexInfos) {
|
|
78761
|
-
typeElements.push(
|
|
79020
|
+
typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 ? createElidedInformationPlaceholder(context) : void 0));
|
|
78762
79021
|
}
|
|
78763
79022
|
const properties = resolvedType.properties;
|
|
78764
79023
|
if (!properties) {
|
|
@@ -78860,6 +79119,7 @@ ${lanes.join("\n")}
|
|
|
78860
79119
|
if (propertySymbol.flags & 98304) {
|
|
78861
79120
|
const writeType = getWriteTypeOfSymbol(propertySymbol);
|
|
78862
79121
|
if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
|
|
79122
|
+
const symbolMapper = getSymbolLinks(propertySymbol).mapper;
|
|
78863
79123
|
const getterDeclaration = getDeclarationOfKind(
|
|
78864
79124
|
propertySymbol,
|
|
78865
79125
|
177
|
|
@@ -78869,7 +79129,7 @@ ${lanes.join("\n")}
|
|
|
78869
79129
|
typeElements.push(
|
|
78870
79130
|
setCommentRange2(
|
|
78871
79131
|
context,
|
|
78872
|
-
signatureToSignatureDeclarationHelper(getterSignature, 177, context, { name: propertyName }),
|
|
79132
|
+
signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, 177, context, { name: propertyName }),
|
|
78873
79133
|
getterDeclaration
|
|
78874
79134
|
)
|
|
78875
79135
|
);
|
|
@@ -78882,7 +79142,7 @@ ${lanes.join("\n")}
|
|
|
78882
79142
|
typeElements.push(
|
|
78883
79143
|
setCommentRange2(
|
|
78884
79144
|
context,
|
|
78885
|
-
signatureToSignatureDeclarationHelper(setterSignature, 178, context, { name: propertyName }),
|
|
79145
|
+
signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, 178, context, { name: propertyName }),
|
|
78886
79146
|
setterDeclaration
|
|
78887
79147
|
)
|
|
78888
79148
|
);
|
|
@@ -79527,7 +79787,7 @@ ${lanes.join("\n")}
|
|
|
79527
79787
|
if (!context.tracker.canTrackSymbol) return;
|
|
79528
79788
|
const firstIdentifier = getFirstIdentifier(accessExpression);
|
|
79529
79789
|
const name = resolveName(
|
|
79530
|
-
|
|
79790
|
+
enclosingDeclaration,
|
|
79531
79791
|
firstIdentifier.escapedText,
|
|
79532
79792
|
111551 | 1048576,
|
|
79533
79793
|
/*nameNotFoundMessage*/
|
|
@@ -79542,6 +79802,24 @@ ${lanes.join("\n")}
|
|
|
79542
79802
|
111551
|
|
79543
79803
|
/* Value */
|
|
79544
79804
|
);
|
|
79805
|
+
} else {
|
|
79806
|
+
const fallback = resolveName(
|
|
79807
|
+
firstIdentifier,
|
|
79808
|
+
firstIdentifier.escapedText,
|
|
79809
|
+
111551 | 1048576,
|
|
79810
|
+
/*nameNotFoundMessage*/
|
|
79811
|
+
void 0,
|
|
79812
|
+
/*isUse*/
|
|
79813
|
+
true
|
|
79814
|
+
);
|
|
79815
|
+
if (fallback) {
|
|
79816
|
+
context.tracker.trackSymbol(
|
|
79817
|
+
fallback,
|
|
79818
|
+
enclosingDeclaration,
|
|
79819
|
+
111551
|
|
79820
|
+
/* Value */
|
|
79821
|
+
);
|
|
79822
|
+
}
|
|
79545
79823
|
}
|
|
79546
79824
|
}
|
|
79547
79825
|
function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {
|
|
@@ -80130,13 +80408,13 @@ ${lanes.join("\n")}
|
|
|
80130
80408
|
const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration);
|
|
80131
80409
|
const decl = declaration ?? symbol.valueDeclaration ?? getDeclarationWithTypeAnnotation(symbol) ?? ((_a2 = symbol.declarations) == null ? void 0 : _a2[0]);
|
|
80132
80410
|
if (decl) {
|
|
80411
|
+
const restore = addSymbolTypeToContext(context, symbol, type);
|
|
80133
80412
|
if (isAccessor(decl)) {
|
|
80134
80413
|
result = syntacticNodeBuilder.serializeTypeOfAccessor(decl, symbol, context);
|
|
80135
80414
|
} else if (hasInferredType(decl) && !nodeIsSynthesized(decl) && !(getObjectFlags(type) & 196608)) {
|
|
80136
|
-
const restore = addSymbolTypeToContext(context, symbol, type);
|
|
80137
80415
|
result = syntacticNodeBuilder.serializeTypeOfDeclaration(decl, symbol, context);
|
|
80138
|
-
restore();
|
|
80139
80416
|
}
|
|
80417
|
+
restore();
|
|
80140
80418
|
}
|
|
80141
80419
|
if (!result) {
|
|
80142
80420
|
if (addUndefinedForParameter) {
|
|
@@ -80308,10 +80586,7 @@ ${lanes.join("\n")}
|
|
|
80308
80586
|
/*context*/
|
|
80309
80587
|
void 0
|
|
80310
80588
|
);
|
|
80311
|
-
|
|
80312
|
-
setTextRange2(context, updated, node2);
|
|
80313
|
-
}
|
|
80314
|
-
return updated;
|
|
80589
|
+
return setTextRange2(context, updated, node2);
|
|
80315
80590
|
}
|
|
80316
80591
|
}
|
|
80317
80592
|
function serializeTypeName(context, node, isTypeOf, typeArguments) {
|
|
@@ -86907,8 +87182,8 @@ ${lanes.join("\n")}
|
|
|
86907
87182
|
/* Index */
|
|
86908
87183
|
);
|
|
86909
87184
|
}
|
|
86910
|
-
function createIndexInfo(keyType, type, isReadonly, declaration) {
|
|
86911
|
-
return { keyType, type, isReadonly, declaration };
|
|
87185
|
+
function createIndexInfo(keyType, type, isReadonly, declaration, components) {
|
|
87186
|
+
return { keyType, type, isReadonly, declaration, components };
|
|
86912
87187
|
}
|
|
86913
87188
|
function getIndexInfosOfSymbol(symbol) {
|
|
86914
87189
|
const indexSymbol = getIndexSymbol(symbol);
|
|
@@ -87446,6 +87721,9 @@ ${lanes.join("\n")}
|
|
|
87446
87721
|
case "Number":
|
|
87447
87722
|
checkNoTypeArguments(node);
|
|
87448
87723
|
return numberType;
|
|
87724
|
+
case "BigInt":
|
|
87725
|
+
checkNoTypeArguments(node);
|
|
87726
|
+
return bigintType;
|
|
87449
87727
|
case "Boolean":
|
|
87450
87728
|
checkNoTypeArguments(node);
|
|
87451
87729
|
return booleanType;
|
|
@@ -90117,7 +90395,7 @@ ${lanes.join("\n")}
|
|
|
90117
90395
|
return result;
|
|
90118
90396
|
}
|
|
90119
90397
|
function getIndexInfoWithReadonly(info, readonly) {
|
|
90120
|
-
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info;
|
|
90398
|
+
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration, info.components) : info;
|
|
90121
90399
|
}
|
|
90122
90400
|
function createLiteralType(flags, value2, symbol, regularType) {
|
|
90123
90401
|
const type = createTypeWithSymbol(flags, symbol);
|
|
@@ -90889,7 +91167,7 @@ ${lanes.join("\n")}
|
|
|
90889
91167
|
return type.restrictiveInstantiation;
|
|
90890
91168
|
}
|
|
90891
91169
|
function instantiateIndexInfo(info, mapper) {
|
|
90892
|
-
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
|
|
91170
|
+
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components);
|
|
90893
91171
|
}
|
|
90894
91172
|
function isContextSensitive(node) {
|
|
90895
91173
|
Debug.assert(node.kind !== 174 || isObjectLiteralMethod(node));
|
|
@@ -95250,7 +95528,7 @@ ${lanes.join("\n")}
|
|
|
95250
95528
|
}
|
|
95251
95529
|
}
|
|
95252
95530
|
}
|
|
95253
|
-
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
95531
|
+
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly, info.declaration, info.components)));
|
|
95254
95532
|
result.objectFlags |= getObjectFlags(type) & (4096 | 262144);
|
|
95255
95533
|
return result;
|
|
95256
95534
|
}
|
|
@@ -96786,6 +97064,7 @@ ${lanes.join("\n")}
|
|
|
96786
97064
|
return target.kind === 108;
|
|
96787
97065
|
case 235:
|
|
96788
97066
|
case 217:
|
|
97067
|
+
case 238:
|
|
96789
97068
|
return isMatchingReference(source.expression, target);
|
|
96790
97069
|
case 211:
|
|
96791
97070
|
case 212:
|
|
@@ -98826,6 +99105,7 @@ ${lanes.join("\n")}
|
|
|
98826
99105
|
if (checkDerived) {
|
|
98827
99106
|
return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
|
|
98828
99107
|
}
|
|
99108
|
+
type = type.flags & 2 ? unknownUnionType : type;
|
|
98829
99109
|
const trueType2 = getNarrowedType(
|
|
98830
99110
|
type,
|
|
98831
99111
|
candidate,
|
|
@@ -98834,7 +99114,7 @@ ${lanes.join("\n")}
|
|
|
98834
99114
|
/*checkDerived*/
|
|
98835
99115
|
false
|
|
98836
99116
|
);
|
|
98837
|
-
return filterType(type, (t) => !isTypeSubsetOf(t, trueType2));
|
|
99117
|
+
return recombineUnknownType(filterType(type, (t) => !isTypeSubsetOf(t, trueType2)));
|
|
98838
99118
|
}
|
|
98839
99119
|
if (type.flags & 3) {
|
|
98840
99120
|
return candidate;
|
|
@@ -98948,6 +99228,7 @@ ${lanes.join("\n")}
|
|
|
98948
99228
|
return narrowTypeByCallExpression(type, expr, assumeTrue);
|
|
98949
99229
|
case 217:
|
|
98950
99230
|
case 235:
|
|
99231
|
+
case 238:
|
|
98951
99232
|
return narrowType(type, expr.expression, assumeTrue);
|
|
98952
99233
|
case 226:
|
|
98953
99234
|
return narrowTypeByBinaryExpression(type, expr, assumeTrue);
|
|
@@ -99371,8 +99652,9 @@ ${lanes.join("\n")}
|
|
|
99371
99652
|
}
|
|
99372
99653
|
if (isJsxOpeningFragment(node)) {
|
|
99373
99654
|
const file = getSourceFileOfNode(node);
|
|
99374
|
-
const
|
|
99375
|
-
if (
|
|
99655
|
+
const entity = getJsxFactoryEntity(file);
|
|
99656
|
+
if (entity) {
|
|
99657
|
+
const localJsxNamespace = getFirstIdentifier(entity).escapedText;
|
|
99376
99658
|
resolveName(
|
|
99377
99659
|
jsxFactoryLocation,
|
|
99378
99660
|
localJsxNamespace,
|
|
@@ -101732,12 +102014,22 @@ ${lanes.join("\n")}
|
|
|
101732
102014
|
/* ESSymbol */
|
|
101733
102015
|
);
|
|
101734
102016
|
}
|
|
102017
|
+
function isSymbolWithComputedName(symbol) {
|
|
102018
|
+
var _a2;
|
|
102019
|
+
const firstDecl = (_a2 = symbol.declarations) == null ? void 0 : _a2[0];
|
|
102020
|
+
return firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name);
|
|
102021
|
+
}
|
|
101735
102022
|
function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
|
|
102023
|
+
var _a2;
|
|
101736
102024
|
const propTypes = [];
|
|
102025
|
+
let components;
|
|
101737
102026
|
for (let i = offset; i < properties.length; i++) {
|
|
101738
102027
|
const prop = properties[i];
|
|
101739
102028
|
if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
|
|
101740
102029
|
propTypes.push(getTypeOfSymbol(properties[i]));
|
|
102030
|
+
if (isSymbolWithComputedName(properties[i])) {
|
|
102031
|
+
components = append(components, (_a2 = properties[i].declarations) == null ? void 0 : _a2[0]);
|
|
102032
|
+
}
|
|
101741
102033
|
}
|
|
101742
102034
|
}
|
|
101743
102035
|
const unionType = propTypes.length ? getUnionType(
|
|
@@ -101745,7 +102037,14 @@ ${lanes.join("\n")}
|
|
|
101745
102037
|
2
|
|
101746
102038
|
/* Subtype */
|
|
101747
102039
|
) : undefinedType;
|
|
101748
|
-
return createIndexInfo(
|
|
102040
|
+
return createIndexInfo(
|
|
102041
|
+
keyType,
|
|
102042
|
+
unionType,
|
|
102043
|
+
isReadonly,
|
|
102044
|
+
/*declaration*/
|
|
102045
|
+
void 0,
|
|
102046
|
+
components
|
|
102047
|
+
);
|
|
101749
102048
|
}
|
|
101750
102049
|
function getImmediateAliasedSymbol(symbol) {
|
|
101751
102050
|
Debug.assert((symbol.flags & 2097152) !== 0, "Should only get Alias here.");
|
|
@@ -102332,6 +102631,9 @@ ${lanes.join("\n")}
|
|
|
102332
102631
|
return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);
|
|
102333
102632
|
}
|
|
102334
102633
|
function getJsxElementChildrenPropertyName(jsxNamespace) {
|
|
102634
|
+
if (compilerOptions.jsx === 4 || compilerOptions.jsx === 5) {
|
|
102635
|
+
return "children";
|
|
102636
|
+
}
|
|
102335
102637
|
return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace);
|
|
102336
102638
|
}
|
|
102337
102639
|
function getUninstantiatedJsxSignaturesOfType(elementType, caller) {
|
|
@@ -104010,8 +104312,8 @@ ${lanes.join("\n")}
|
|
|
104010
104312
|
}
|
|
104011
104313
|
}
|
|
104012
104314
|
function getEffectiveCheckNode(argument) {
|
|
104013
|
-
|
|
104014
|
-
return
|
|
104315
|
+
const flags = isInJSFile(argument) ? 1 | 32 | -2147483648 : 1 | 32;
|
|
104316
|
+
return skipOuterExpressions(argument, flags);
|
|
104015
104317
|
}
|
|
104016
104318
|
function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain, inferenceContext) {
|
|
104017
104319
|
const errorOutputContainer = { errors: void 0, skipLogging: true };
|
|
@@ -104436,11 +104738,16 @@ ${lanes.join("\n")}
|
|
|
104436
104738
|
if (!result) {
|
|
104437
104739
|
result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
|
|
104438
104740
|
}
|
|
104741
|
+
const links = getNodeLinks(node);
|
|
104742
|
+
if (links.resolvedSignature !== resolvingSignature && !candidatesOutArray) {
|
|
104743
|
+
Debug.assert(links.resolvedSignature);
|
|
104744
|
+
return links.resolvedSignature;
|
|
104745
|
+
}
|
|
104439
104746
|
if (result) {
|
|
104440
104747
|
return result;
|
|
104441
104748
|
}
|
|
104442
104749
|
result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
|
|
104443
|
-
|
|
104750
|
+
links.resolvedSignature = result;
|
|
104444
104751
|
if (reportErrors2) {
|
|
104445
104752
|
if (!headMessage && isInstanceof) {
|
|
104446
104753
|
headMessage = Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method;
|
|
@@ -105456,7 +105763,7 @@ ${lanes.join("\n")}
|
|
|
105456
105763
|
resolutionStart = resolutionTargets.length;
|
|
105457
105764
|
}
|
|
105458
105765
|
links.resolvedSignature = resolvingSignature;
|
|
105459
|
-
|
|
105766
|
+
const result = resolveSignature(
|
|
105460
105767
|
node,
|
|
105461
105768
|
candidatesOutArray,
|
|
105462
105769
|
checkMode || 0
|
|
@@ -105464,9 +105771,6 @@ ${lanes.join("\n")}
|
|
|
105464
105771
|
);
|
|
105465
105772
|
resolutionStart = saveResolutionStart;
|
|
105466
105773
|
if (result !== resolvingSignature) {
|
|
105467
|
-
if (links.resolvedSignature !== resolvingSignature) {
|
|
105468
|
-
result = links.resolvedSignature;
|
|
105469
|
-
}
|
|
105470
105774
|
links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached;
|
|
105471
105775
|
}
|
|
105472
105776
|
return result;
|
|
@@ -105843,6 +106147,11 @@ ${lanes.join("\n")}
|
|
|
105843
106147
|
])) {
|
|
105844
106148
|
grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
|
|
105845
106149
|
}
|
|
106150
|
+
if (compilerOptions.erasableSyntaxOnly) {
|
|
106151
|
+
const start = skipTrivia(file.text, node.pos);
|
|
106152
|
+
const end = node.expression.pos;
|
|
106153
|
+
diagnostics.add(createFileDiagnostic(file, start, end - start, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled));
|
|
106154
|
+
}
|
|
105846
106155
|
}
|
|
105847
106156
|
return checkAssertionWorker(node, checkMode);
|
|
105848
106157
|
}
|
|
@@ -106073,12 +106382,12 @@ ${lanes.join("\n")}
|
|
|
106073
106382
|
}
|
|
106074
106383
|
}
|
|
106075
106384
|
function checkImportMetaProperty(node) {
|
|
106076
|
-
if (
|
|
106385
|
+
if (100 <= moduleKind && moduleKind <= 199) {
|
|
106077
106386
|
if (getSourceFileOfNode(node).impliedNodeFormat !== 99) {
|
|
106078
106387
|
error2(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
106079
106388
|
}
|
|
106080
106389
|
} else if (moduleKind < 6 && moduleKind !== 4) {
|
|
106081
|
-
error2(node, Diagnostics.
|
|
106390
|
+
error2(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext);
|
|
106082
106391
|
}
|
|
106083
106392
|
const file = getSourceFileOfNode(node);
|
|
106084
106393
|
Debug.assert(!!(file.flags & 8388608), "Containing file is missing import meta node flag.");
|
|
@@ -106953,7 +107262,7 @@ ${lanes.join("\n")}
|
|
|
106953
107262
|
}
|
|
106954
107263
|
return !someType(operandConstraint, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts);
|
|
106955
107264
|
}
|
|
106956
|
-
const type = checkExpressionCached(node.expression);
|
|
107265
|
+
const type = getBaseConstraintOrType(checkExpressionCached(node.expression));
|
|
106957
107266
|
if (!isLiteralType(type)) {
|
|
106958
107267
|
return false;
|
|
106959
107268
|
}
|
|
@@ -107229,19 +107538,7 @@ ${lanes.join("\n")}
|
|
|
107229
107538
|
const exprType = checkExpression(node.body);
|
|
107230
107539
|
const returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags);
|
|
107231
107540
|
if (returnOrPromisedType) {
|
|
107232
|
-
|
|
107233
|
-
if ((functionFlags & 3) === 2) {
|
|
107234
|
-
const awaitedType = checkAwaitedType(
|
|
107235
|
-
exprType,
|
|
107236
|
-
/*withAlias*/
|
|
107237
|
-
false,
|
|
107238
|
-
effectiveCheckNode,
|
|
107239
|
-
Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
|
|
107240
|
-
);
|
|
107241
|
-
checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode);
|
|
107242
|
-
} else {
|
|
107243
|
-
checkTypeAssignableToAndOptionallyElaborate(exprType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode);
|
|
107244
|
-
}
|
|
107541
|
+
checkReturnExpression(node, returnOrPromisedType, node.body, node.body, exprType);
|
|
107245
107542
|
}
|
|
107246
107543
|
}
|
|
107247
107544
|
}
|
|
@@ -107295,7 +107592,7 @@ ${lanes.join("\n")}
|
|
|
107295
107592
|
}
|
|
107296
107593
|
if (isReadonlySymbol(symbol)) {
|
|
107297
107594
|
if (symbol.flags & 4 && isAccessExpression(expr) && expr.expression.kind === 110) {
|
|
107298
|
-
const ctor =
|
|
107595
|
+
const ctor = getControlFlowContainer(expr);
|
|
107299
107596
|
if (!(ctor && (ctor.kind === 176 || isJSConstructor(ctor)))) {
|
|
107300
107597
|
return true;
|
|
107301
107598
|
}
|
|
@@ -107326,7 +107623,7 @@ ${lanes.join("\n")}
|
|
|
107326
107623
|
function checkReferenceExpression(expr, invalidReferenceMessage, invalidOptionalChainMessage) {
|
|
107327
107624
|
const node = skipOuterExpressions(
|
|
107328
107625
|
expr,
|
|
107329
|
-
|
|
107626
|
+
38 | 1
|
|
107330
107627
|
/* Parentheses */
|
|
107331
107628
|
);
|
|
107332
107629
|
if (node.kind !== 80 && !isAccessExpression(node)) {
|
|
@@ -107399,6 +107696,7 @@ ${lanes.join("\n")}
|
|
|
107399
107696
|
}
|
|
107400
107697
|
switch (moduleKind) {
|
|
107401
107698
|
case 100:
|
|
107699
|
+
case 101:
|
|
107402
107700
|
case 199:
|
|
107403
107701
|
if (sourceFile.impliedNodeFormat === 1) {
|
|
107404
107702
|
span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
@@ -107419,7 +107717,7 @@ ${lanes.join("\n")}
|
|
|
107419
107717
|
// fallthrough
|
|
107420
107718
|
default:
|
|
107421
107719
|
span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
107422
|
-
const message2 = isAwaitExpression(node) ? Diagnostics.
|
|
107720
|
+
const message2 = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher;
|
|
107423
107721
|
diagnostics.add(createFileDiagnostic(sourceFile, span.start, span.length, message2));
|
|
107424
107722
|
hasError = true;
|
|
107425
107723
|
break;
|
|
@@ -108059,7 +108357,7 @@ ${lanes.join("\n")}
|
|
|
108059
108357
|
}
|
|
108060
108358
|
const leftTarget = skipOuterExpressions(
|
|
108061
108359
|
left2,
|
|
108062
|
-
|
|
108360
|
+
63
|
|
108063
108361
|
/* All */
|
|
108064
108362
|
);
|
|
108065
108363
|
const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget);
|
|
@@ -109460,6 +109758,9 @@ ${lanes.join("\n")}
|
|
|
109460
109758
|
31
|
|
109461
109759
|
/* ParameterPropertyModifier */
|
|
109462
109760
|
)) {
|
|
109761
|
+
if (compilerOptions.erasableSyntaxOnly) {
|
|
109762
|
+
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
109763
|
+
}
|
|
109463
109764
|
if (!(func.kind === 176 && nodeIsPresent(func.body))) {
|
|
109464
109765
|
error2(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);
|
|
109465
109766
|
}
|
|
@@ -112959,7 +113260,6 @@ ${lanes.join("\n")}
|
|
|
112959
113260
|
}
|
|
112960
113261
|
const signature = getSignatureFromDeclaration(container);
|
|
112961
113262
|
const returnType = getReturnTypeOfSignature(signature);
|
|
112962
|
-
const functionFlags = getFunctionFlags(container);
|
|
112963
113263
|
if (strictNullChecks || node.expression || returnType.flags & 131072) {
|
|
112964
113264
|
const exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType;
|
|
112965
113265
|
if (container.kind === 178) {
|
|
@@ -112967,26 +113267,57 @@ ${lanes.join("\n")}
|
|
|
112967
113267
|
error2(node, Diagnostics.Setters_cannot_return_a_value);
|
|
112968
113268
|
}
|
|
112969
113269
|
} else if (container.kind === 176) {
|
|
112970
|
-
|
|
113270
|
+
const exprType2 = node.expression ? checkExpressionCached(node.expression) : undefinedType;
|
|
113271
|
+
if (node.expression && !checkTypeAssignableToAndOptionallyElaborate(exprType2, returnType, node, node.expression)) {
|
|
112971
113272
|
error2(node, Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);
|
|
112972
113273
|
}
|
|
112973
113274
|
} else if (getReturnTypeFromAnnotation(container)) {
|
|
112974
|
-
const unwrappedReturnType = unwrapReturnType(returnType,
|
|
112975
|
-
|
|
112976
|
-
exprType,
|
|
112977
|
-
/*withAlias*/
|
|
112978
|
-
false,
|
|
112979
|
-
node,
|
|
112980
|
-
Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
|
|
112981
|
-
) : exprType;
|
|
112982
|
-
if (unwrappedReturnType) {
|
|
112983
|
-
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression);
|
|
112984
|
-
}
|
|
113275
|
+
const unwrappedReturnType = unwrapReturnType(returnType, getFunctionFlags(container)) ?? returnType;
|
|
113276
|
+
checkReturnExpression(container, unwrappedReturnType, node, node.expression, exprType);
|
|
112985
113277
|
}
|
|
112986
113278
|
} else if (container.kind !== 176 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeUndefinedVoidOrAny(container, returnType)) {
|
|
112987
113279
|
error2(node, Diagnostics.Not_all_code_paths_return_a_value);
|
|
112988
113280
|
}
|
|
112989
113281
|
}
|
|
113282
|
+
function checkReturnExpression(container, unwrappedReturnType, node, expr, exprType, inConditionalExpression = false) {
|
|
113283
|
+
const excludeJSDocTypeAssertions = isInJSFile(node);
|
|
113284
|
+
const functionFlags = getFunctionFlags(container);
|
|
113285
|
+
if (expr) {
|
|
113286
|
+
const unwrappedExpr = skipParentheses(expr, excludeJSDocTypeAssertions);
|
|
113287
|
+
if (isConditionalExpression(unwrappedExpr)) {
|
|
113288
|
+
checkReturnExpression(
|
|
113289
|
+
container,
|
|
113290
|
+
unwrappedReturnType,
|
|
113291
|
+
node,
|
|
113292
|
+
unwrappedExpr.whenTrue,
|
|
113293
|
+
checkExpression(unwrappedExpr.whenTrue),
|
|
113294
|
+
/*inConditionalExpression*/
|
|
113295
|
+
true
|
|
113296
|
+
);
|
|
113297
|
+
checkReturnExpression(
|
|
113298
|
+
container,
|
|
113299
|
+
unwrappedReturnType,
|
|
113300
|
+
node,
|
|
113301
|
+
unwrappedExpr.whenFalse,
|
|
113302
|
+
checkExpression(unwrappedExpr.whenFalse),
|
|
113303
|
+
/*inConditionalExpression*/
|
|
113304
|
+
true
|
|
113305
|
+
);
|
|
113306
|
+
return;
|
|
113307
|
+
}
|
|
113308
|
+
}
|
|
113309
|
+
const inReturnStatement = node.kind === 253;
|
|
113310
|
+
const unwrappedExprType = functionFlags & 2 ? checkAwaitedType(
|
|
113311
|
+
exprType,
|
|
113312
|
+
/*withAlias*/
|
|
113313
|
+
false,
|
|
113314
|
+
node,
|
|
113315
|
+
Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
|
|
113316
|
+
) : exprType;
|
|
113317
|
+
const effectiveExpr = expr && getEffectiveCheckNode(expr);
|
|
113318
|
+
const errorNode = inReturnStatement && !inConditionalExpression ? node : effectiveExpr;
|
|
113319
|
+
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, errorNode, effectiveExpr);
|
|
113320
|
+
}
|
|
112990
113321
|
function checkWithStatement(node) {
|
|
112991
113322
|
if (!checkGrammarStatementInAmbientContext(node)) {
|
|
112992
113323
|
if (node.flags & 65536) {
|
|
@@ -113118,7 +113449,7 @@ ${lanes.join("\n")}
|
|
|
113118
113449
|
const typeDeclaration = symbol.valueDeclaration;
|
|
113119
113450
|
if (typeDeclaration && isClassLike(typeDeclaration)) {
|
|
113120
113451
|
for (const member of typeDeclaration.members) {
|
|
113121
|
-
if (!isStatic(member) && !hasBindableName(member)) {
|
|
113452
|
+
if ((!isStaticIndex && !isStatic(member) || isStaticIndex && isStatic(member)) && !hasBindableName(member)) {
|
|
113122
113453
|
const symbol2 = getSymbolOfDeclaration(member);
|
|
113123
113454
|
checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2));
|
|
113124
113455
|
}
|
|
@@ -113604,6 +113935,13 @@ ${lanes.join("\n")}
|
|
|
113604
113935
|
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, member, errorNode) {
|
|
113605
113936
|
const isJs = isInJSFile(node);
|
|
113606
113937
|
const nodeInAmbientContext = !!(node.flags & 33554432);
|
|
113938
|
+
if (memberHasOverrideModifier && (member == null ? void 0 : member.valueDeclaration) && isClassElement(member.valueDeclaration) && member.valueDeclaration.name && isNonBindableDynamicName(member.valueDeclaration.name)) {
|
|
113939
|
+
error2(
|
|
113940
|
+
errorNode,
|
|
113941
|
+
isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic : Diagnostics.This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic
|
|
113942
|
+
);
|
|
113943
|
+
return 2;
|
|
113944
|
+
}
|
|
113607
113945
|
if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
|
|
113608
113946
|
const thisType = memberIsStatic ? staticType : typeWithThis;
|
|
113609
113947
|
const baseType = memberIsStatic ? baseStaticType : baseWithThis;
|
|
@@ -114220,6 +114558,9 @@ ${lanes.join("\n")}
|
|
|
114220
114558
|
checkCollisionsForDeclarationName(node, node.name);
|
|
114221
114559
|
checkExportsOnMergedDeclarations(node);
|
|
114222
114560
|
node.members.forEach(checkEnumMember);
|
|
114561
|
+
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432)) {
|
|
114562
|
+
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
114563
|
+
}
|
|
114223
114564
|
computeEnumMemberValues(node);
|
|
114224
114565
|
const enumSymbol = getSymbolOfDeclaration(node);
|
|
114225
114566
|
const firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind);
|
|
@@ -114321,6 +114662,9 @@ ${lanes.join("\n")}
|
|
|
114321
114662
|
checkExportsOnMergedDeclarations(node);
|
|
114322
114663
|
const symbol = getSymbolOfDeclaration(node);
|
|
114323
114664
|
if (symbol.flags & 512 && !inAmbientContext && isInstantiatedModule(node, shouldPreserveConstEnums(compilerOptions))) {
|
|
114665
|
+
if (compilerOptions.erasableSyntaxOnly) {
|
|
114666
|
+
error2(node.name, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
114667
|
+
}
|
|
114324
114668
|
if (getIsolatedModules(compilerOptions) && !getSourceFileOfNode(node).externalModuleIndicator) {
|
|
114325
114669
|
error2(node.name, Diagnostics.Namespaces_are_not_allowed_in_global_script_files_when_0_is_enabled_If_this_file_is_not_intended_to_be_a_global_script_set_moduleDetection_to_force_or_add_an_empty_export_statement, isolatedModulesLikeFlagName);
|
|
114326
114670
|
}
|
|
@@ -114659,10 +115003,20 @@ ${lanes.join("\n")}
|
|
|
114659
115003
|
if (validForTypeAttributes && override) {
|
|
114660
115004
|
return;
|
|
114661
115005
|
}
|
|
114662
|
-
|
|
114663
|
-
|
|
114664
|
-
|
|
114665
|
-
|
|
115006
|
+
if (!moduleSupportsImportAttributes(moduleKind)) {
|
|
115007
|
+
return grammarErrorOnNode(
|
|
115008
|
+
node,
|
|
115009
|
+
isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve
|
|
115010
|
+
);
|
|
115011
|
+
}
|
|
115012
|
+
if (moduleKind === 199 && !isImportAttributes2) {
|
|
115013
|
+
return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert);
|
|
115014
|
+
}
|
|
115015
|
+
if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1) {
|
|
115016
|
+
return grammarErrorOnNode(
|
|
115017
|
+
node,
|
|
115018
|
+
isImportAttributes2 ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls
|
|
115019
|
+
);
|
|
114666
115020
|
}
|
|
114667
115021
|
const isTypeOnly = isJSDocImportTag(declaration) || (isImportDeclaration(declaration) ? (_a2 = declaration.importClause) == null ? void 0 : _a2.isTypeOnly : declaration.isTypeOnly);
|
|
114668
115022
|
if (isTypeOnly) {
|
|
@@ -114707,7 +115061,7 @@ ${lanes.join("\n")}
|
|
|
114707
115061
|
}
|
|
114708
115062
|
}
|
|
114709
115063
|
}
|
|
114710
|
-
if (!importClause.isTypeOnly && moduleKind
|
|
115064
|
+
if (!importClause.isTypeOnly && 101 <= moduleKind && moduleKind <= 199 && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
|
|
114711
115065
|
error2(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]);
|
|
114712
115066
|
}
|
|
114713
115067
|
} else if (noUncheckedSideEffectImports && !importClause) {
|
|
@@ -114727,6 +115081,9 @@ ${lanes.join("\n")}
|
|
|
114727
115081
|
return;
|
|
114728
115082
|
}
|
|
114729
115083
|
checkGrammarModifiers(node);
|
|
115084
|
+
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432)) {
|
|
115085
|
+
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
115086
|
+
}
|
|
114730
115087
|
if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
|
|
114731
115088
|
checkImportBinding(node);
|
|
114732
115089
|
markLinkedReferences(
|
|
@@ -114871,6 +115228,9 @@ ${lanes.join("\n")}
|
|
|
114871
115228
|
if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
|
|
114872
115229
|
return;
|
|
114873
115230
|
}
|
|
115231
|
+
if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432)) {
|
|
115232
|
+
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
115233
|
+
}
|
|
114874
115234
|
const container = node.parent.kind === 307 ? node.parent : node.parent.parent;
|
|
114875
115235
|
if (container.kind === 267 && !isAmbientModule(container)) {
|
|
114876
115236
|
if (node.isExportEquals) {
|
|
@@ -115914,7 +116274,7 @@ ${lanes.join("\n")}
|
|
|
115914
116274
|
name,
|
|
115915
116275
|
meaning,
|
|
115916
116276
|
/*ignoreErrors*/
|
|
115917
|
-
|
|
116277
|
+
true,
|
|
115918
116278
|
/*dontResolveAlias*/
|
|
115919
116279
|
true
|
|
115920
116280
|
);
|
|
@@ -115924,8 +116284,9 @@ ${lanes.join("\n")}
|
|
|
115924
116284
|
return resolveEntityName(
|
|
115925
116285
|
name,
|
|
115926
116286
|
/*meaning*/
|
|
115927
|
-
1
|
|
115928
|
-
/*
|
|
116287
|
+
1,
|
|
116288
|
+
/*ignoreErrors*/
|
|
116289
|
+
true
|
|
115929
116290
|
);
|
|
115930
116291
|
}
|
|
115931
116292
|
return void 0;
|
|
@@ -116116,8 +116477,9 @@ ${lanes.join("\n")}
|
|
|
116116
116477
|
if (location && location.kind === 304) {
|
|
116117
116478
|
return resolveEntityName(
|
|
116118
116479
|
location.name,
|
|
116119
|
-
111551 | 2097152
|
|
116120
|
-
/*
|
|
116480
|
+
111551 | 2097152,
|
|
116481
|
+
/*ignoreErrors*/
|
|
116482
|
+
true
|
|
116121
116483
|
);
|
|
116122
116484
|
}
|
|
116123
116485
|
return void 0;
|
|
@@ -116129,15 +116491,17 @@ ${lanes.join("\n")}
|
|
|
116129
116491
|
// Skip for invalid syntax like this: export { "x" }
|
|
116130
116492
|
resolveEntityName(
|
|
116131
116493
|
name,
|
|
116132
|
-
111551 | 788968 | 1920 | 2097152
|
|
116133
|
-
/*
|
|
116494
|
+
111551 | 788968 | 1920 | 2097152,
|
|
116495
|
+
/*ignoreErrors*/
|
|
116496
|
+
true
|
|
116134
116497
|
)
|
|
116135
116498
|
);
|
|
116136
116499
|
} else {
|
|
116137
116500
|
return resolveEntityName(
|
|
116138
116501
|
node,
|
|
116139
|
-
111551 | 788968 | 1920 | 2097152
|
|
116140
|
-
/*
|
|
116502
|
+
111551 | 788968 | 1920 | 2097152,
|
|
116503
|
+
/*ignoreErrors*/
|
|
116504
|
+
true
|
|
116141
116505
|
);
|
|
116142
116506
|
}
|
|
116143
116507
|
}
|
|
@@ -117174,6 +117538,44 @@ ${lanes.join("\n")}
|
|
|
117174
117538
|
for (const info of infoList) {
|
|
117175
117539
|
if (info.declaration) continue;
|
|
117176
117540
|
if (info === anyBaseTypeIndexInfo) continue;
|
|
117541
|
+
if (info.components) {
|
|
117542
|
+
const allComponentComputedNamesSerializable = every(info.components, (e) => {
|
|
117543
|
+
var _a2;
|
|
117544
|
+
return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && enclosing && ((_a2 = isEntityNameVisible(
|
|
117545
|
+
e.name.expression,
|
|
117546
|
+
enclosing,
|
|
117547
|
+
/*shouldComputeAliasToMakeVisible*/
|
|
117548
|
+
false
|
|
117549
|
+
)) == null ? void 0 : _a2.accessibility) === 0);
|
|
117550
|
+
});
|
|
117551
|
+
if (allComponentComputedNamesSerializable) {
|
|
117552
|
+
const newComponents = filter(info.components, (e) => {
|
|
117553
|
+
return !hasLateBindableName(e);
|
|
117554
|
+
});
|
|
117555
|
+
result.push(...map(newComponents, (e) => {
|
|
117556
|
+
trackComputedName(e.name.expression);
|
|
117557
|
+
const mods = infoList === staticInfos ? [factory.createModifier(
|
|
117558
|
+
126
|
|
117559
|
+
/* StaticKeyword */
|
|
117560
|
+
)] : void 0;
|
|
117561
|
+
return factory.createPropertyDeclaration(
|
|
117562
|
+
append(mods, info.isReadonly ? factory.createModifier(
|
|
117563
|
+
148
|
|
117564
|
+
/* ReadonlyKeyword */
|
|
117565
|
+
) : void 0),
|
|
117566
|
+
e.name,
|
|
117567
|
+
(isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(
|
|
117568
|
+
58
|
|
117569
|
+
/* QuestionToken */
|
|
117570
|
+
) : void 0,
|
|
117571
|
+
nodeBuilder.typeToTypeNode(getTypeOfSymbol(e.symbol), enclosing, flags, internalFlags, tracker),
|
|
117572
|
+
/*initializer*/
|
|
117573
|
+
void 0
|
|
117574
|
+
);
|
|
117575
|
+
}));
|
|
117576
|
+
continue;
|
|
117577
|
+
}
|
|
117578
|
+
}
|
|
117177
117579
|
const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
|
|
117178
117580
|
if (node && infoList === staticInfos) {
|
|
117179
117581
|
(node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(
|
|
@@ -117187,6 +117589,27 @@ ${lanes.join("\n")}
|
|
|
117187
117589
|
}
|
|
117188
117590
|
}
|
|
117189
117591
|
return result;
|
|
117592
|
+
function trackComputedName(accessExpression) {
|
|
117593
|
+
if (!tracker.trackSymbol) return;
|
|
117594
|
+
const firstIdentifier = getFirstIdentifier(accessExpression);
|
|
117595
|
+
const name = resolveName(
|
|
117596
|
+
firstIdentifier,
|
|
117597
|
+
firstIdentifier.escapedText,
|
|
117598
|
+
111551 | 1048576,
|
|
117599
|
+
/*nameNotFoundMessage*/
|
|
117600
|
+
void 0,
|
|
117601
|
+
/*isUse*/
|
|
117602
|
+
true
|
|
117603
|
+
);
|
|
117604
|
+
if (name) {
|
|
117605
|
+
tracker.trackSymbol(
|
|
117606
|
+
name,
|
|
117607
|
+
enclosing,
|
|
117608
|
+
111551
|
|
117609
|
+
/* Value */
|
|
117610
|
+
);
|
|
117611
|
+
}
|
|
117612
|
+
}
|
|
117190
117613
|
}
|
|
117191
117614
|
};
|
|
117192
117615
|
function isImportRequiredByAugmentation(node) {
|
|
@@ -118311,6 +118734,7 @@ ${lanes.join("\n")}
|
|
|
118311
118734
|
}
|
|
118312
118735
|
switch (moduleKind) {
|
|
118313
118736
|
case 100:
|
|
118737
|
+
case 101:
|
|
118314
118738
|
case 199:
|
|
118315
118739
|
if (sourceFile.impliedNodeFormat === 1) {
|
|
118316
118740
|
diagnostics.add(
|
|
@@ -118329,7 +118753,7 @@ ${lanes.join("\n")}
|
|
|
118329
118753
|
// fallthrough
|
|
118330
118754
|
default:
|
|
118331
118755
|
diagnostics.add(
|
|
118332
|
-
createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.
|
|
118756
|
+
createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher)
|
|
118333
118757
|
);
|
|
118334
118758
|
break;
|
|
118335
118759
|
}
|
|
@@ -118491,7 +118915,7 @@ ${lanes.join("\n")}
|
|
|
118491
118915
|
}
|
|
118492
118916
|
}
|
|
118493
118917
|
function checkGrammarForInvalidDynamicName(node, message2) {
|
|
118494
|
-
if (isNonBindableDynamicName(node)) {
|
|
118918
|
+
if (isNonBindableDynamicName(node) && !isEntityNameExpression(isElementAccessExpression(node) ? skipParentheses(node.argumentExpression) : node.expression)) {
|
|
118495
118919
|
return grammarErrorOnNode(node, message2);
|
|
118496
118920
|
}
|
|
118497
118921
|
}
|
|
@@ -118958,17 +119382,17 @@ ${lanes.join("\n")}
|
|
|
118958
119382
|
return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
|
|
118959
119383
|
}
|
|
118960
119384
|
if (moduleKind === 5) {
|
|
118961
|
-
return grammarErrorOnNode(node, Diagnostics.
|
|
119385
|
+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext);
|
|
118962
119386
|
}
|
|
118963
119387
|
if (node.typeArguments) {
|
|
118964
119388
|
return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
|
|
118965
119389
|
}
|
|
118966
119390
|
const nodeArguments = node.arguments;
|
|
118967
|
-
if (
|
|
119391
|
+
if (!(100 <= moduleKind && moduleKind <= 199) && moduleKind !== 99 && moduleKind !== 200) {
|
|
118968
119392
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
118969
119393
|
if (nodeArguments.length > 1) {
|
|
118970
119394
|
const importAttributesArgument = nodeArguments[1];
|
|
118971
|
-
return grammarErrorOnNode(importAttributesArgument, Diagnostics.
|
|
119395
|
+
return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve);
|
|
118972
119396
|
}
|
|
118973
119397
|
}
|
|
118974
119398
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
@@ -123992,7 +124416,7 @@ ${lanes.join("\n")}
|
|
|
123992
124416
|
return updated;
|
|
123993
124417
|
}
|
|
123994
124418
|
function visitParenthesizedExpression(node) {
|
|
123995
|
-
const innerExpression = skipOuterExpressions(node.expression, ~(
|
|
124419
|
+
const innerExpression = skipOuterExpressions(node.expression, ~(38 | 16));
|
|
123996
124420
|
if (isAssertionExpression(innerExpression) || isSatisfiesExpression(innerExpression)) {
|
|
123997
124421
|
const expression = visitNode(node.expression, visitor, isExpression);
|
|
123998
124422
|
Debug.assert(expression);
|
|
@@ -143681,7 +144105,7 @@ ${lanes.join("\n")}
|
|
|
143681
144105
|
if (node === (importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim[0])) {
|
|
143682
144106
|
return visitImportOrRequireCall(importsAndRequiresToRewriteOrShim.shift());
|
|
143683
144107
|
}
|
|
143684
|
-
|
|
144108
|
+
// fallthrough
|
|
143685
144109
|
default:
|
|
143686
144110
|
if ((importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim.length) && rangeContainsRange(node, importsAndRequiresToRewriteOrShim[0])) {
|
|
143687
144111
|
return visitEachChild(node, visitor, context);
|
|
@@ -144533,11 +144957,7 @@ ${lanes.join("\n")}
|
|
|
144533
144957
|
if (isSetAccessor(node.parent)) {
|
|
144534
144958
|
return createAccessorTypeError(node.parent);
|
|
144535
144959
|
}
|
|
144536
|
-
const addUndefined = resolver.requiresAddingImplicitUndefined(
|
|
144537
|
-
node,
|
|
144538
|
-
/*enclosingDeclaration*/
|
|
144539
|
-
void 0
|
|
144540
|
-
);
|
|
144960
|
+
const addUndefined = resolver.requiresAddingImplicitUndefined(node, node.parent);
|
|
144541
144961
|
if (!addUndefined && node.initializer) {
|
|
144542
144962
|
return createExpressionError(node.initializer);
|
|
144543
144963
|
}
|
|
@@ -146334,6 +146754,7 @@ ${lanes.join("\n")}
|
|
|
146334
146754
|
case 6:
|
|
146335
146755
|
case 5:
|
|
146336
146756
|
case 100:
|
|
146757
|
+
case 101:
|
|
146337
146758
|
case 199:
|
|
146338
146759
|
case 1:
|
|
146339
146760
|
return transformImpliedNodeFormatDependentModule;
|
|
@@ -153197,45 +153618,6 @@ ${lanes.join("\n")}
|
|
|
153197
153618
|
}
|
|
153198
153619
|
return resolutions;
|
|
153199
153620
|
}
|
|
153200
|
-
function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
|
|
153201
|
-
return forEachProjectReference(
|
|
153202
|
-
/*projectReferences*/
|
|
153203
|
-
void 0,
|
|
153204
|
-
resolvedProjectReferences,
|
|
153205
|
-
(resolvedRef, parent2) => resolvedRef && cb(resolvedRef, parent2)
|
|
153206
|
-
);
|
|
153207
|
-
}
|
|
153208
|
-
function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {
|
|
153209
|
-
let seenResolvedRefs;
|
|
153210
|
-
return worker(
|
|
153211
|
-
projectReferences,
|
|
153212
|
-
resolvedProjectReferences,
|
|
153213
|
-
/*parent*/
|
|
153214
|
-
void 0
|
|
153215
|
-
);
|
|
153216
|
-
function worker(projectReferences2, resolvedProjectReferences2, parent2) {
|
|
153217
|
-
if (cbRef) {
|
|
153218
|
-
const result = cbRef(projectReferences2, parent2);
|
|
153219
|
-
if (result) return result;
|
|
153220
|
-
}
|
|
153221
|
-
let skipChildren;
|
|
153222
|
-
return forEach(
|
|
153223
|
-
resolvedProjectReferences2,
|
|
153224
|
-
(resolvedRef, index) => {
|
|
153225
|
-
if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {
|
|
153226
|
-
(skipChildren ?? (skipChildren = /* @__PURE__ */ new Set())).add(resolvedRef);
|
|
153227
|
-
return void 0;
|
|
153228
|
-
}
|
|
153229
|
-
const result = cbResolvedRef(resolvedRef, parent2, index);
|
|
153230
|
-
if (result || !resolvedRef) return result;
|
|
153231
|
-
(seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path);
|
|
153232
|
-
}
|
|
153233
|
-
) || forEach(
|
|
153234
|
-
resolvedProjectReferences2,
|
|
153235
|
-
(resolvedRef) => resolvedRef && !(skipChildren == null ? void 0 : skipChildren.has(resolvedRef)) ? worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : void 0
|
|
153236
|
-
);
|
|
153237
|
-
}
|
|
153238
|
-
}
|
|
153239
153621
|
var inferredTypesContainingFile = "__inferred type names__.ts";
|
|
153240
153622
|
function getInferredLibraryNameResolveFrom(options, currentDirectory, libFileName) {
|
|
153241
153623
|
const containingDirectory = options.configFilePath ? getDirectoryPath(options.configFilePath) : currentDirectory;
|
|
@@ -153251,13 +153633,6 @@ ${lanes.join("\n")}
|
|
|
153251
153633
|
}
|
|
153252
153634
|
return "@typescript/lib-" + path14;
|
|
153253
153635
|
}
|
|
153254
|
-
function getLibNameFromLibReference(libReference) {
|
|
153255
|
-
return toFileNameLowerCase(libReference.fileName);
|
|
153256
|
-
}
|
|
153257
|
-
function getLibFileNameFromLibReference(libReference) {
|
|
153258
|
-
const libName = getLibNameFromLibReference(libReference);
|
|
153259
|
-
return libMap.get(libName);
|
|
153260
|
-
}
|
|
153261
153636
|
function isReferencedFile(reason) {
|
|
153262
153637
|
switch (reason == null ? void 0 : reason.kind) {
|
|
153263
153638
|
case 3:
|
|
@@ -153492,11 +153867,13 @@ ${lanes.join("\n")}
|
|
|
153492
153867
|
typeScriptVersion: typeScriptVersion3
|
|
153493
153868
|
};
|
|
153494
153869
|
}
|
|
153495
|
-
function createProgram(
|
|
153870
|
+
function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
|
|
153496
153871
|
var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
153497
|
-
|
|
153498
|
-
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3 } =
|
|
153499
|
-
let { oldProgram } =
|
|
153872
|
+
let _createProgramOptions = isArray(_rootNamesOrOptions) ? createCreateProgramOptions(_rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : _rootNamesOrOptions;
|
|
153873
|
+
const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion3, host: createProgramOptionsHost } = _createProgramOptions;
|
|
153874
|
+
let { oldProgram } = _createProgramOptions;
|
|
153875
|
+
_createProgramOptions = void 0;
|
|
153876
|
+
_rootNamesOrOptions = void 0;
|
|
153500
153877
|
for (const option of commandLineOptionOfCustomType) {
|
|
153501
153878
|
if (hasProperty(options, option.name)) {
|
|
153502
153879
|
if (typeof options[option.name] === "string") {
|
|
@@ -153509,16 +153886,12 @@ ${lanes.join("\n")}
|
|
|
153509
153886
|
let processingOtherFiles;
|
|
153510
153887
|
let files;
|
|
153511
153888
|
let symlinks;
|
|
153512
|
-
let commonSourceDirectory;
|
|
153513
153889
|
let typeChecker;
|
|
153514
153890
|
let classifiableNames;
|
|
153515
|
-
let fileReasons = createMultiMap();
|
|
153516
153891
|
let filesWithReferencesProcessed;
|
|
153517
|
-
let fileReasonsToChain;
|
|
153518
|
-
let reasonToRelatedInfo;
|
|
153519
153892
|
let cachedBindAndCheckDiagnosticsForFile;
|
|
153520
153893
|
let cachedDeclarationDiagnosticsForFile;
|
|
153521
|
-
|
|
153894
|
+
const programDiagnostics = createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax);
|
|
153522
153895
|
let automaticTypeDirectiveNames;
|
|
153523
153896
|
let automaticTypeDirectiveResolutions;
|
|
153524
153897
|
let resolvedLibReferences;
|
|
@@ -153540,13 +153913,12 @@ ${lanes.join("\n")}
|
|
|
153540
153913
|
true
|
|
153541
153914
|
);
|
|
153542
153915
|
mark("beforeProgram");
|
|
153543
|
-
const host =
|
|
153916
|
+
const host = createProgramOptionsHost || createCompilerHost(options);
|
|
153544
153917
|
const configParsingHost = parseConfigHostFromCompilerHostLike(host);
|
|
153545
153918
|
let skipDefaultLib = options.noLib;
|
|
153546
153919
|
const getDefaultLibraryFileName = memoize(() => host.getDefaultLibFileName(options));
|
|
153547
153920
|
const defaultLibraryPath = host.getDefaultLibLocation ? host.getDefaultLibLocation() : getDirectoryPath(getDefaultLibraryFileName());
|
|
153548
|
-
|
|
153549
|
-
let lazyProgramDiagnosticExplainingFile = [];
|
|
153921
|
+
let skipVerifyCompilerOptions = false;
|
|
153550
153922
|
const currentDirectory = host.getCurrentDirectory();
|
|
153551
153923
|
const supportedExtensions = getSupportedExtensions(options);
|
|
153552
153924
|
const supportedExtensionsWithJsonIfResolveJsonModule = getSupportedExtensionsWithJsonIfResolveJsonModule(options, supportedExtensions);
|
|
@@ -153831,7 +154203,7 @@ ${lanes.join("\n")}
|
|
|
153831
154203
|
getTypeCount: () => getTypeChecker().getTypeCount(),
|
|
153832
154204
|
getInstantiationCount: () => getTypeChecker().getInstantiationCount(),
|
|
153833
154205
|
getRelationCacheSizes: () => getTypeChecker().getRelationCacheSizes(),
|
|
153834
|
-
getFileProcessingDiagnostics: () =>
|
|
154206
|
+
getFileProcessingDiagnostics: () => programDiagnostics.getFileProcessingDiagnostics(),
|
|
153835
154207
|
getAutomaticTypeDirectiveNames: () => automaticTypeDirectiveNames,
|
|
153836
154208
|
getAutomaticTypeDirectiveResolutions: () => automaticTypeDirectiveResolutions,
|
|
153837
154209
|
isSourceFileFromExternalLibrary,
|
|
@@ -153847,6 +154219,7 @@ ${lanes.join("\n")}
|
|
|
153847
154219
|
resolvedModules,
|
|
153848
154220
|
resolvedTypeReferenceDirectiveNames,
|
|
153849
154221
|
resolvedLibReferences,
|
|
154222
|
+
getProgramDiagnosticsContainer: () => programDiagnostics,
|
|
153850
154223
|
getResolvedModule,
|
|
153851
154224
|
getResolvedModuleFromModuleSpecifier,
|
|
153852
154225
|
getResolvedTypeReferenceDirective,
|
|
@@ -153879,70 +154252,19 @@ ${lanes.join("\n")}
|
|
|
153879
154252
|
realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
|
|
153880
154253
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
|
153881
154254
|
getCanonicalFileName,
|
|
153882
|
-
getFileIncludeReasons: () =>
|
|
154255
|
+
getFileIncludeReasons: () => programDiagnostics.getFileReasons(),
|
|
153883
154256
|
structureIsReused,
|
|
153884
154257
|
writeFile: writeFile22,
|
|
153885
154258
|
getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
|
|
153886
154259
|
};
|
|
153887
154260
|
onProgramCreateComplete();
|
|
153888
|
-
|
|
154261
|
+
if (!skipVerifyCompilerOptions) {
|
|
154262
|
+
verifyCompilerOptions();
|
|
154263
|
+
}
|
|
153889
154264
|
mark("afterProgram");
|
|
153890
154265
|
measure("Program", "beforeProgram", "afterProgram");
|
|
153891
154266
|
(_p = tracing) == null ? void 0 : _p.pop();
|
|
153892
154267
|
return program;
|
|
153893
|
-
function updateAndGetProgramDiagnostics() {
|
|
153894
|
-
if (lazyProgramDiagnosticExplainingFile) {
|
|
153895
|
-
fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
|
|
153896
|
-
switch (diagnostic.kind) {
|
|
153897
|
-
case 1:
|
|
153898
|
-
return programDiagnostics.add(
|
|
153899
|
-
createDiagnosticExplainingFile(
|
|
153900
|
-
diagnostic.file && getSourceFileByPath(diagnostic.file),
|
|
153901
|
-
diagnostic.fileProcessingReason,
|
|
153902
|
-
diagnostic.diagnostic,
|
|
153903
|
-
diagnostic.args || emptyArray
|
|
153904
|
-
)
|
|
153905
|
-
);
|
|
153906
|
-
case 0:
|
|
153907
|
-
return programDiagnostics.add(filePreprocessingLibreferenceDiagnostic(diagnostic));
|
|
153908
|
-
case 2:
|
|
153909
|
-
return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
|
|
153910
|
-
default:
|
|
153911
|
-
Debug.assertNever(diagnostic);
|
|
153912
|
-
}
|
|
153913
|
-
});
|
|
153914
|
-
lazyProgramDiagnosticExplainingFile.forEach(
|
|
153915
|
-
({ file, diagnostic, args }) => programDiagnostics.add(
|
|
153916
|
-
createDiagnosticExplainingFile(
|
|
153917
|
-
file,
|
|
153918
|
-
/*fileProcessingReason*/
|
|
153919
|
-
void 0,
|
|
153920
|
-
diagnostic,
|
|
153921
|
-
args
|
|
153922
|
-
)
|
|
153923
|
-
)
|
|
153924
|
-
);
|
|
153925
|
-
lazyProgramDiagnosticExplainingFile = void 0;
|
|
153926
|
-
fileReasonsToChain = void 0;
|
|
153927
|
-
reasonToRelatedInfo = void 0;
|
|
153928
|
-
}
|
|
153929
|
-
return programDiagnostics;
|
|
153930
|
-
}
|
|
153931
|
-
function filePreprocessingLibreferenceDiagnostic({ reason }) {
|
|
153932
|
-
const { file, pos, end } = getReferencedFileLocation(program, reason);
|
|
153933
|
-
const libReference = file.libReferenceDirectives[reason.index];
|
|
153934
|
-
const libName = getLibNameFromLibReference(libReference);
|
|
153935
|
-
const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts");
|
|
153936
|
-
const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity);
|
|
153937
|
-
return createFileDiagnostic(
|
|
153938
|
-
file,
|
|
153939
|
-
Debug.checkDefined(pos),
|
|
153940
|
-
Debug.checkDefined(end) - pos,
|
|
153941
|
-
suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0,
|
|
153942
|
-
libName,
|
|
153943
|
-
suggestion
|
|
153944
|
-
);
|
|
153945
|
-
}
|
|
153946
154268
|
function getResolvedModule(file, moduleName2, mode) {
|
|
153947
154269
|
var _a22;
|
|
153948
154270
|
return (_a22 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a22.get(moduleName2, mode);
|
|
@@ -153991,7 +154313,7 @@ ${lanes.join("\n")}
|
|
|
153991
154313
|
function addResolutionDiagnostics(resolution) {
|
|
153992
154314
|
var _a22;
|
|
153993
154315
|
if (!((_a22 = resolution.resolutionDiagnostics) == null ? void 0 : _a22.length)) return;
|
|
153994
|
-
|
|
154316
|
+
programDiagnostics.addFileProcessingDiagnostic({
|
|
153995
154317
|
kind: 2,
|
|
153996
154318
|
diagnostics: resolution.resolutionDiagnostics
|
|
153997
154319
|
});
|
|
@@ -154085,16 +154407,19 @@ ${lanes.join("\n")}
|
|
|
154085
154407
|
return toPath3(fileName, currentDirectory, getCanonicalFileName);
|
|
154086
154408
|
}
|
|
154087
154409
|
function getCommonSourceDirectory2() {
|
|
154088
|
-
|
|
154089
|
-
|
|
154090
|
-
commonSourceDirectory
|
|
154091
|
-
options,
|
|
154092
|
-
() => mapDefined(emittedFiles, (file) => file.isDeclarationFile ? void 0 : file.fileName),
|
|
154093
|
-
currentDirectory,
|
|
154094
|
-
getCanonicalFileName,
|
|
154095
|
-
(commonSourceDirectory2) => checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory2)
|
|
154096
|
-
);
|
|
154410
|
+
let commonSourceDirectory = programDiagnostics.getCommonSourceDirectory();
|
|
154411
|
+
if (commonSourceDirectory !== void 0) {
|
|
154412
|
+
return commonSourceDirectory;
|
|
154097
154413
|
}
|
|
154414
|
+
const emittedFiles = filter(files, (file) => sourceFileMayBeEmitted(file, program));
|
|
154415
|
+
commonSourceDirectory = getCommonSourceDirectory(
|
|
154416
|
+
options,
|
|
154417
|
+
() => mapDefined(emittedFiles, (file) => file.isDeclarationFile ? void 0 : file.fileName),
|
|
154418
|
+
currentDirectory,
|
|
154419
|
+
getCanonicalFileName,
|
|
154420
|
+
(commonSourceDirectory2) => checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory2)
|
|
154421
|
+
);
|
|
154422
|
+
programDiagnostics.setCommonSourceDirectory(commonSourceDirectory);
|
|
154098
154423
|
return commonSourceDirectory;
|
|
154099
154424
|
}
|
|
154100
154425
|
function getClassifiableNames() {
|
|
@@ -154405,9 +154730,10 @@ ${lanes.join("\n")}
|
|
|
154405
154730
|
}
|
|
154406
154731
|
filesByName.set(path14, filesByName.get(oldFile.path));
|
|
154407
154732
|
});
|
|
154733
|
+
const isConfigIdentical = oldOptions.configFile && oldOptions.configFile === options.configFile || !oldOptions.configFile && !options.configFile && !optionsHaveChanges(oldOptions, options, optionDeclarations);
|
|
154734
|
+
programDiagnostics.reuseStateFromOldProgram(oldProgram.getProgramDiagnosticsContainer(), isConfigIdentical);
|
|
154735
|
+
skipVerifyCompilerOptions = isConfigIdentical;
|
|
154408
154736
|
files = newSourceFiles;
|
|
154409
|
-
fileReasons = oldProgram.getFileIncludeReasons();
|
|
154410
|
-
fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
|
|
154411
154737
|
automaticTypeDirectiveNames = oldProgram.getAutomaticTypeDirectiveNames();
|
|
154412
154738
|
automaticTypeDirectiveResolutions = oldProgram.getAutomaticTypeDirectiveResolutions();
|
|
154413
154739
|
sourceFileToPackageName = oldProgram.sourceFileToPackageName;
|
|
@@ -154623,7 +154949,7 @@ ${lanes.join("\n")}
|
|
|
154623
154949
|
if (skipTypeChecking(sourceFile, options, program)) {
|
|
154624
154950
|
return emptyArray;
|
|
154625
154951
|
}
|
|
154626
|
-
const programDiagnosticsInFile =
|
|
154952
|
+
const programDiagnosticsInFile = programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(sourceFile.fileName);
|
|
154627
154953
|
if (!((_a22 = sourceFile.commentDirectives) == null ? void 0 : _a22.length)) {
|
|
154628
154954
|
return programDiagnosticsInFile;
|
|
154629
154955
|
}
|
|
@@ -154997,15 +155323,15 @@ ${lanes.join("\n")}
|
|
|
154997
155323
|
}
|
|
154998
155324
|
function getOptionsDiagnostics() {
|
|
154999
155325
|
return sortAndDeduplicateDiagnostics(concatenate(
|
|
155000
|
-
|
|
155326
|
+
programDiagnostics.getCombinedDiagnostics(program).getGlobalDiagnostics(),
|
|
155001
155327
|
getOptionsDiagnosticsOfConfigFile()
|
|
155002
155328
|
));
|
|
155003
155329
|
}
|
|
155004
155330
|
function getOptionsDiagnosticsOfConfigFile() {
|
|
155005
155331
|
if (!options.configFile) return emptyArray;
|
|
155006
|
-
let diagnostics =
|
|
155332
|
+
let diagnostics = programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(options.configFile.fileName);
|
|
155007
155333
|
forEachResolvedProjectReference2((resolvedRef) => {
|
|
155008
|
-
diagnostics = concatenate(diagnostics,
|
|
155334
|
+
diagnostics = concatenate(diagnostics, programDiagnostics.getCombinedDiagnostics(program).getDiagnostics(resolvedRef.sourceFile.fileName));
|
|
155009
155335
|
});
|
|
155010
155336
|
return diagnostics;
|
|
155011
155337
|
}
|
|
@@ -155220,7 +155546,7 @@ ${lanes.join("\n")}
|
|
|
155220
155546
|
);
|
|
155221
155547
|
}
|
|
155222
155548
|
function reportFileNamesDifferOnlyInCasingError(fileName, existingFile, reason) {
|
|
155223
|
-
const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(
|
|
155549
|
+
const hasExistingReasonToReportErrorOn = !isReferencedFile(reason) && some(programDiagnostics.getFileReasons().get(existingFile.path), isReferencedFile);
|
|
155224
155550
|
if (hasExistingReasonToReportErrorOn) {
|
|
155225
155551
|
addFilePreprocessingFileExplainingDiagnostic(existingFile, reason, Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing, [existingFile.fileName, fileName]);
|
|
155226
155552
|
} else {
|
|
@@ -155407,7 +155733,7 @@ ${lanes.join("\n")}
|
|
|
155407
155733
|
}
|
|
155408
155734
|
function addFileIncludeReason(file, reason, checkExisting) {
|
|
155409
155735
|
if (file && (!checkExisting || !isReferencedFile(reason) || !(filesWithReferencesProcessed == null ? void 0 : filesWithReferencesProcessed.has(reason.file)))) {
|
|
155410
|
-
|
|
155736
|
+
programDiagnostics.getFileReasons().add(file.path, reason);
|
|
155411
155737
|
return true;
|
|
155412
155738
|
}
|
|
155413
155739
|
return false;
|
|
@@ -155575,6 +155901,16 @@ ${lanes.join("\n")}
|
|
|
155575
155901
|
var _a22, _b22, _c22, _d2, _e2;
|
|
155576
155902
|
const existing = resolvedLibProcessing == null ? void 0 : resolvedLibProcessing.get(libFileName);
|
|
155577
155903
|
if (existing) return existing;
|
|
155904
|
+
if (options.libReplacement === false) {
|
|
155905
|
+
const result2 = {
|
|
155906
|
+
resolution: {
|
|
155907
|
+
resolvedModule: void 0
|
|
155908
|
+
},
|
|
155909
|
+
actual: combinePaths(defaultLibraryPath, libFileName)
|
|
155910
|
+
};
|
|
155911
|
+
(resolvedLibProcessing ?? (resolvedLibProcessing = /* @__PURE__ */ new Map())).set(libFileName, result2);
|
|
155912
|
+
return result2;
|
|
155913
|
+
}
|
|
155578
155914
|
if (structureIsReused !== 0 && oldProgram && !hasInvalidatedLibResolutions(libFileName)) {
|
|
155579
155915
|
const oldResolution = (_a22 = oldProgram.resolvedLibReferences) == null ? void 0 : _a22.get(libFileName);
|
|
155580
155916
|
if (oldResolution) {
|
|
@@ -155622,7 +155958,7 @@ ${lanes.join("\n")}
|
|
|
155622
155958
|
{ kind: 7, file: file.path, index }
|
|
155623
155959
|
);
|
|
155624
155960
|
} else {
|
|
155625
|
-
|
|
155961
|
+
programDiagnostics.addFileProcessingDiagnostic({
|
|
155626
155962
|
kind: 0,
|
|
155627
155963
|
reason: { kind: 7, file: file.path, index }
|
|
155628
155964
|
});
|
|
@@ -155685,10 +156021,11 @@ ${lanes.join("\n")}
|
|
|
155685
156021
|
if (!sourceFile.isDeclarationFile) {
|
|
155686
156022
|
const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory));
|
|
155687
156023
|
if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) {
|
|
155688
|
-
|
|
156024
|
+
programDiagnostics.addLazyConfigDiagnostic(
|
|
155689
156025
|
sourceFile,
|
|
155690
156026
|
Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,
|
|
155691
|
-
|
|
156027
|
+
sourceFile.fileName,
|
|
156028
|
+
rootDirectory
|
|
155692
156029
|
);
|
|
155693
156030
|
allFilesBelongToPath = false;
|
|
155694
156031
|
}
|
|
@@ -155807,7 +156144,7 @@ ${lanes.join("\n")}
|
|
|
155807
156144
|
}
|
|
155808
156145
|
const outputFile = options.outFile;
|
|
155809
156146
|
if (!options.tsBuildInfoFile && options.incremental && !outputFile && !options.configFilePath) {
|
|
155810
|
-
programDiagnostics.
|
|
156147
|
+
programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
|
|
155811
156148
|
}
|
|
155812
156149
|
verifyDeprecatedCompilerOptions();
|
|
155813
156150
|
verifyProjectReferences();
|
|
@@ -155815,10 +156152,11 @@ ${lanes.join("\n")}
|
|
|
155815
156152
|
const rootPaths = new Set(rootNames.map(toPath32));
|
|
155816
156153
|
for (const file of files) {
|
|
155817
156154
|
if (sourceFileMayBeEmitted(file, program) && !rootPaths.has(file.path)) {
|
|
155818
|
-
|
|
156155
|
+
programDiagnostics.addLazyConfigDiagnostic(
|
|
155819
156156
|
file,
|
|
155820
156157
|
Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern,
|
|
155821
|
-
|
|
156158
|
+
file.fileName,
|
|
156159
|
+
options.configFilePath || ""
|
|
155822
156160
|
);
|
|
155823
156161
|
}
|
|
155824
156162
|
}
|
|
@@ -155909,14 +156247,14 @@ ${lanes.join("\n")}
|
|
|
155909
156247
|
}
|
|
155910
156248
|
} else if (firstNonAmbientExternalModuleSourceFile && languageVersion < 2 && options.module === 0) {
|
|
155911
156249
|
const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
|
|
155912
|
-
programDiagnostics.
|
|
156250
|
+
programDiagnostics.addConfigDiagnostic(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none));
|
|
155913
156251
|
}
|
|
155914
156252
|
if (outputFile && !options.emitDeclarationOnly) {
|
|
155915
156253
|
if (options.module && !(options.module === 2 || options.module === 4)) {
|
|
155916
156254
|
createDiagnosticForOptionName(Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0, "outFile", "module");
|
|
155917
156255
|
} else if (options.module === void 0 && firstNonAmbientExternalModuleSourceFile) {
|
|
155918
156256
|
const span = getErrorSpanForNode(firstNonAmbientExternalModuleSourceFile, typeof firstNonAmbientExternalModuleSourceFile.externalModuleIndicator === "boolean" ? firstNonAmbientExternalModuleSourceFile : firstNonAmbientExternalModuleSourceFile.externalModuleIndicator);
|
|
155919
|
-
programDiagnostics.
|
|
156257
|
+
programDiagnostics.addConfigDiagnostic(createFileDiagnostic(firstNonAmbientExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system, "outFile"));
|
|
155920
156258
|
}
|
|
155921
156259
|
}
|
|
155922
156260
|
if (getResolveJsonModule(options)) {
|
|
@@ -156005,7 +156343,8 @@ ${lanes.join("\n")}
|
|
|
156005
156343
|
}
|
|
156006
156344
|
if (ModuleKind[moduleKind] && (100 <= moduleKind && moduleKind <= 199) && !(3 <= moduleResolution && moduleResolution <= 99)) {
|
|
156007
156345
|
const moduleKindName = ModuleKind[moduleKind];
|
|
156008
|
-
|
|
156346
|
+
const moduleResolutionName = ModuleResolutionKind[moduleKindName] ? moduleKindName : "Node16";
|
|
156347
|
+
createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1, moduleResolutionName, moduleKindName);
|
|
156009
156348
|
} else if (ModuleResolutionKind[moduleResolution] && (3 <= moduleResolution && moduleResolution <= 99) && !(100 <= moduleKind && moduleKind <= 199)) {
|
|
156010
156349
|
const moduleResolutionName = ModuleResolutionKind[moduleResolution];
|
|
156011
156350
|
createOptionValueDiagnostic("module", Diagnostics.Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1, moduleResolutionName, moduleResolutionName);
|
|
@@ -156167,90 +156506,8 @@ ${lanes.join("\n")}
|
|
|
156167
156506
|
}
|
|
156168
156507
|
});
|
|
156169
156508
|
}
|
|
156170
|
-
function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
|
|
156171
|
-
let seenReasons;
|
|
156172
|
-
const reasons = file && fileReasons.get(file.path);
|
|
156173
|
-
let fileIncludeReasons;
|
|
156174
|
-
let relatedInfo;
|
|
156175
|
-
let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0;
|
|
156176
|
-
let fileIncludeReasonDetails;
|
|
156177
|
-
let redirectInfo;
|
|
156178
|
-
let cachedChain = file && (fileReasonsToChain == null ? void 0 : fileReasonsToChain.get(file.path));
|
|
156179
|
-
let chain;
|
|
156180
|
-
if (cachedChain) {
|
|
156181
|
-
if (cachedChain.fileIncludeReasonDetails) {
|
|
156182
|
-
seenReasons = new Set(reasons);
|
|
156183
|
-
reasons == null ? void 0 : reasons.forEach(populateRelatedInfo);
|
|
156184
|
-
} else {
|
|
156185
|
-
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
156186
|
-
}
|
|
156187
|
-
redirectInfo = cachedChain.redirectInfo;
|
|
156188
|
-
} else {
|
|
156189
|
-
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
156190
|
-
redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, getCompilerOptionsForFile(file));
|
|
156191
|
-
}
|
|
156192
|
-
if (fileProcessingReason) processReason(fileProcessingReason);
|
|
156193
|
-
const processedExtraReason = (seenReasons == null ? void 0 : seenReasons.size) !== (reasons == null ? void 0 : reasons.length);
|
|
156194
|
-
if (locationReason && (seenReasons == null ? void 0 : seenReasons.size) === 1) seenReasons = void 0;
|
|
156195
|
-
if (seenReasons && cachedChain) {
|
|
156196
|
-
if (cachedChain.details && !processedExtraReason) {
|
|
156197
|
-
chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args || emptyArray);
|
|
156198
|
-
} else if (cachedChain.fileIncludeReasonDetails) {
|
|
156199
|
-
if (!processedExtraReason) {
|
|
156200
|
-
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
156201
|
-
fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails;
|
|
156202
|
-
} else {
|
|
156203
|
-
fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length);
|
|
156204
|
-
}
|
|
156205
|
-
} else {
|
|
156206
|
-
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
156207
|
-
fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next, fileIncludeReasons[0]];
|
|
156208
|
-
} else {
|
|
156209
|
-
fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length), fileIncludeReasons[0]);
|
|
156210
|
-
}
|
|
156211
|
-
}
|
|
156212
|
-
}
|
|
156213
|
-
}
|
|
156214
|
-
if (!chain) {
|
|
156215
|
-
if (!fileIncludeReasonDetails) fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
|
156216
|
-
chain = chainDiagnosticMessages(
|
|
156217
|
-
redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails,
|
|
156218
|
-
diagnostic,
|
|
156219
|
-
...args || emptyArray
|
|
156220
|
-
);
|
|
156221
|
-
}
|
|
156222
|
-
if (file) {
|
|
156223
|
-
if (cachedChain) {
|
|
156224
|
-
if (!cachedChain.fileIncludeReasonDetails || !processedExtraReason && fileIncludeReasonDetails) {
|
|
156225
|
-
cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails;
|
|
156226
|
-
}
|
|
156227
|
-
} else {
|
|
156228
|
-
(fileReasonsToChain ?? (fileReasonsToChain = /* @__PURE__ */ new Map())).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo });
|
|
156229
|
-
}
|
|
156230
|
-
if (!cachedChain.details && !processedExtraReason) cachedChain.details = chain.next;
|
|
156231
|
-
}
|
|
156232
|
-
const location = locationReason && getReferencedFileLocation(program, locationReason);
|
|
156233
|
-
return location && isReferenceFileLocation(location) ? createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : createCompilerDiagnosticFromMessageChain(chain, relatedInfo);
|
|
156234
|
-
function processReason(reason) {
|
|
156235
|
-
if (seenReasons == null ? void 0 : seenReasons.has(reason)) return;
|
|
156236
|
-
(seenReasons ?? (seenReasons = /* @__PURE__ */ new Set())).add(reason);
|
|
156237
|
-
(fileIncludeReasons ?? (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program, reason));
|
|
156238
|
-
populateRelatedInfo(reason);
|
|
156239
|
-
}
|
|
156240
|
-
function populateRelatedInfo(reason) {
|
|
156241
|
-
if (!locationReason && isReferencedFile(reason)) {
|
|
156242
|
-
locationReason = reason;
|
|
156243
|
-
} else if (locationReason !== reason) {
|
|
156244
|
-
relatedInfo = append(relatedInfo, getFileIncludeReasonToRelatedInformation(reason));
|
|
156245
|
-
}
|
|
156246
|
-
}
|
|
156247
|
-
function cachedFileIncludeDetailsHasProcessedExtraReason() {
|
|
156248
|
-
var _a22;
|
|
156249
|
-
return ((_a22 = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a22.length) !== (reasons == null ? void 0 : reasons.length);
|
|
156250
|
-
}
|
|
156251
|
-
}
|
|
156252
156509
|
function addFilePreprocessingFileExplainingDiagnostic(file, fileProcessingReason, diagnostic, args) {
|
|
156253
|
-
|
|
156510
|
+
programDiagnostics.addFileProcessingDiagnostic({
|
|
156254
156511
|
kind: 1,
|
|
156255
156512
|
file: file && file.path,
|
|
156256
156513
|
fileProcessingReason,
|
|
@@ -156258,99 +156515,6 @@ ${lanes.join("\n")}
|
|
|
156258
156515
|
args
|
|
156259
156516
|
});
|
|
156260
156517
|
}
|
|
156261
|
-
function addLazyProgramDiagnosticExplainingFile(file, diagnostic, args) {
|
|
156262
|
-
lazyProgramDiagnosticExplainingFile.push({ file, diagnostic, args });
|
|
156263
|
-
}
|
|
156264
|
-
function getFileIncludeReasonToRelatedInformation(reason) {
|
|
156265
|
-
let relatedInfo = reasonToRelatedInfo == null ? void 0 : reasonToRelatedInfo.get(reason);
|
|
156266
|
-
if (relatedInfo === void 0) (reasonToRelatedInfo ?? (reasonToRelatedInfo = /* @__PURE__ */ new Map())).set(reason, relatedInfo = fileIncludeReasonToRelatedInformation(reason) ?? false);
|
|
156267
|
-
return relatedInfo || void 0;
|
|
156268
|
-
}
|
|
156269
|
-
function fileIncludeReasonToRelatedInformation(reason) {
|
|
156270
|
-
if (isReferencedFile(reason)) {
|
|
156271
|
-
const referenceLocation = getReferencedFileLocation(program, reason);
|
|
156272
|
-
let message22;
|
|
156273
|
-
switch (reason.kind) {
|
|
156274
|
-
case 3:
|
|
156275
|
-
message22 = Diagnostics.File_is_included_via_import_here;
|
|
156276
|
-
break;
|
|
156277
|
-
case 4:
|
|
156278
|
-
message22 = Diagnostics.File_is_included_via_reference_here;
|
|
156279
|
-
break;
|
|
156280
|
-
case 5:
|
|
156281
|
-
message22 = Diagnostics.File_is_included_via_type_library_reference_here;
|
|
156282
|
-
break;
|
|
156283
|
-
case 7:
|
|
156284
|
-
message22 = Diagnostics.File_is_included_via_library_reference_here;
|
|
156285
|
-
break;
|
|
156286
|
-
default:
|
|
156287
|
-
Debug.assertNever(reason);
|
|
156288
|
-
}
|
|
156289
|
-
return isReferenceFileLocation(referenceLocation) ? createFileDiagnostic(
|
|
156290
|
-
referenceLocation.file,
|
|
156291
|
-
referenceLocation.pos,
|
|
156292
|
-
referenceLocation.end - referenceLocation.pos,
|
|
156293
|
-
message22
|
|
156294
|
-
) : void 0;
|
|
156295
|
-
}
|
|
156296
|
-
if (!options.configFile) return void 0;
|
|
156297
|
-
let configFileNode;
|
|
156298
|
-
let message2;
|
|
156299
|
-
switch (reason.kind) {
|
|
156300
|
-
case 0:
|
|
156301
|
-
if (!options.configFile.configFileSpecs) return void 0;
|
|
156302
|
-
const fileName = getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory);
|
|
156303
|
-
const matchedByFiles = getMatchedFileSpec(program, fileName);
|
|
156304
|
-
if (matchedByFiles) {
|
|
156305
|
-
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles);
|
|
156306
|
-
message2 = Diagnostics.File_is_matched_by_files_list_specified_here;
|
|
156307
|
-
break;
|
|
156308
|
-
}
|
|
156309
|
-
const matchedByInclude = getMatchedIncludeSpec(program, fileName);
|
|
156310
|
-
if (!matchedByInclude || !isString(matchedByInclude)) return void 0;
|
|
156311
|
-
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
|
|
156312
|
-
message2 = Diagnostics.File_is_matched_by_include_pattern_specified_here;
|
|
156313
|
-
break;
|
|
156314
|
-
case 1:
|
|
156315
|
-
case 2:
|
|
156316
|
-
const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences == null ? void 0 : resolvedProjectReferences[reason.index]);
|
|
156317
|
-
const referenceInfo = forEachProjectReference(
|
|
156318
|
-
projectReferences,
|
|
156319
|
-
resolvedProjectReferences,
|
|
156320
|
-
(resolvedRef, parent2, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent2 == null ? void 0 : parent2.sourceFile) || options.configFile, index: index2 } : void 0
|
|
156321
|
-
);
|
|
156322
|
-
if (!referenceInfo) return void 0;
|
|
156323
|
-
const { sourceFile, index } = referenceInfo;
|
|
156324
|
-
const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
|
|
156325
|
-
return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(
|
|
156326
|
-
sourceFile,
|
|
156327
|
-
referencesSyntax.elements[index],
|
|
156328
|
-
reason.kind === 2 ? Diagnostics.File_is_output_from_referenced_project_specified_here : Diagnostics.File_is_source_from_referenced_project_specified_here
|
|
156329
|
-
) : void 0;
|
|
156330
|
-
case 8:
|
|
156331
|
-
if (!options.types) return void 0;
|
|
156332
|
-
configFileNode = getOptionsSyntaxByArrayElementValue("types", reason.typeReference);
|
|
156333
|
-
message2 = Diagnostics.File_is_entry_point_of_type_library_specified_here;
|
|
156334
|
-
break;
|
|
156335
|
-
case 6:
|
|
156336
|
-
if (reason.index !== void 0) {
|
|
156337
|
-
configFileNode = getOptionsSyntaxByArrayElementValue("lib", options.lib[reason.index]);
|
|
156338
|
-
message2 = Diagnostics.File_is_library_specified_here;
|
|
156339
|
-
break;
|
|
156340
|
-
}
|
|
156341
|
-
const target = getNameOfScriptTarget(getEmitScriptTarget(options));
|
|
156342
|
-
configFileNode = target ? getOptionsSyntaxByValue("target", target) : void 0;
|
|
156343
|
-
message2 = Diagnostics.File_is_default_library_for_target_specified_here;
|
|
156344
|
-
break;
|
|
156345
|
-
default:
|
|
156346
|
-
Debug.assertNever(reason);
|
|
156347
|
-
}
|
|
156348
|
-
return configFileNode && createDiagnosticForNodeInSourceFile(
|
|
156349
|
-
options.configFile,
|
|
156350
|
-
configFileNode,
|
|
156351
|
-
message2
|
|
156352
|
-
);
|
|
156353
|
-
}
|
|
156354
156518
|
function verifyProjectReferences() {
|
|
156355
156519
|
const buildInfoPath = !options.suppressOutputPathCheck ? getTsBuildInfoEmitOutputFilePath(options) : void 0;
|
|
156356
156520
|
forEachProjectReference(
|
|
@@ -156386,7 +156550,7 @@ ${lanes.join("\n")}
|
|
|
156386
156550
|
forEachPropertyAssignment(pathProp.initializer, key, (keyProps) => {
|
|
156387
156551
|
const initializer = keyProps.initializer;
|
|
156388
156552
|
if (isArrayLiteralExpression(initializer) && initializer.elements.length > valueIndex) {
|
|
156389
|
-
programDiagnostics.
|
|
156553
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, initializer.elements[valueIndex], message2, ...args));
|
|
156390
156554
|
needCompilerDiagnostic = false;
|
|
156391
156555
|
}
|
|
156392
156556
|
});
|
|
@@ -156415,18 +156579,8 @@ ${lanes.join("\n")}
|
|
|
156415
156579
|
createCompilerOptionsDiagnostic(message2, ...args);
|
|
156416
156580
|
}
|
|
156417
156581
|
}
|
|
156418
|
-
function forEachOptionsSyntaxByName(name, callback) {
|
|
156419
|
-
return forEachPropertyAssignment(getCompilerOptionsObjectLiteralSyntax(), name, callback);
|
|
156420
|
-
}
|
|
156421
156582
|
function forEachOptionPathsSyntax(callback) {
|
|
156422
|
-
return forEachOptionsSyntaxByName("paths", callback);
|
|
156423
|
-
}
|
|
156424
|
-
function getOptionsSyntaxByValue(name, value2) {
|
|
156425
|
-
return forEachOptionsSyntaxByName(name, (property) => isStringLiteral(property.initializer) && property.initializer.text === value2 ? property.initializer : void 0);
|
|
156426
|
-
}
|
|
156427
|
-
function getOptionsSyntaxByArrayElementValue(name, value2) {
|
|
156428
|
-
const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax();
|
|
156429
|
-
return compilerOptionsObjectLiteralSyntax && getPropertyArrayElementValue(compilerOptionsObjectLiteralSyntax, name, value2);
|
|
156583
|
+
return forEachOptionsSyntaxByName(getCompilerOptionsObjectLiteralSyntax(), "paths", callback);
|
|
156430
156584
|
}
|
|
156431
156585
|
function createDiagnosticForOptionName(message2, option1, option2, option3) {
|
|
156432
156586
|
createDiagnosticForOption(
|
|
@@ -156454,9 +156608,9 @@ ${lanes.join("\n")}
|
|
|
156454
156608
|
function createDiagnosticForReference(sourceFile, index, message2, ...args) {
|
|
156455
156609
|
const referencesSyntax = forEachTsConfigPropArray(sourceFile || options.configFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
|
|
156456
156610
|
if (referencesSyntax && referencesSyntax.elements.length > index) {
|
|
156457
|
-
programDiagnostics.
|
|
156611
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message2, ...args));
|
|
156458
156612
|
} else {
|
|
156459
|
-
programDiagnostics.
|
|
156613
|
+
programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(message2, ...args));
|
|
156460
156614
|
}
|
|
156461
156615
|
}
|
|
156462
156616
|
function createDiagnosticForOption(onKey, option1, option2, message2, ...args) {
|
|
@@ -156470,14 +156624,14 @@ ${lanes.join("\n")}
|
|
|
156470
156624
|
const compilerOptionsProperty = getCompilerOptionsPropertySyntax();
|
|
156471
156625
|
if (compilerOptionsProperty) {
|
|
156472
156626
|
if ("messageText" in message2) {
|
|
156473
|
-
programDiagnostics.
|
|
156627
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(options.configFile, compilerOptionsProperty.name, message2));
|
|
156474
156628
|
} else {
|
|
156475
|
-
programDiagnostics.
|
|
156629
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, compilerOptionsProperty.name, message2, ...args));
|
|
156476
156630
|
}
|
|
156477
156631
|
} else if ("messageText" in message2) {
|
|
156478
|
-
programDiagnostics.
|
|
156632
|
+
programDiagnostics.addConfigDiagnostic(createCompilerDiagnosticFromMessageChain(message2));
|
|
156479
156633
|
} else {
|
|
156480
|
-
programDiagnostics.
|
|
156634
|
+
programDiagnostics.addConfigDiagnostic(createCompilerDiagnostic(message2, ...args));
|
|
156481
156635
|
}
|
|
156482
156636
|
}
|
|
156483
156637
|
function getCompilerOptionsObjectLiteralSyntax() {
|
|
@@ -156501,9 +156655,9 @@ ${lanes.join("\n")}
|
|
|
156501
156655
|
let needsCompilerDiagnostic = false;
|
|
156502
156656
|
forEachPropertyAssignment(objectLiteral, key1, (prop) => {
|
|
156503
156657
|
if ("messageText" in message2) {
|
|
156504
|
-
programDiagnostics.
|
|
156658
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message2));
|
|
156505
156659
|
} else {
|
|
156506
|
-
programDiagnostics.
|
|
156660
|
+
programDiagnostics.addConfigDiagnostic(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message2, ...args));
|
|
156507
156661
|
}
|
|
156508
156662
|
needsCompilerDiagnostic = true;
|
|
156509
156663
|
}, key2);
|
|
@@ -156511,7 +156665,7 @@ ${lanes.join("\n")}
|
|
|
156511
156665
|
}
|
|
156512
156666
|
function blockEmittingOfFile(emitFileName, diag2) {
|
|
156513
156667
|
hasEmitBlockingDiagnostics.set(toPath32(emitFileName), true);
|
|
156514
|
-
programDiagnostics.
|
|
156668
|
+
programDiagnostics.addConfigDiagnostic(diag2);
|
|
156515
156669
|
}
|
|
156516
156670
|
function isEmittedFile(file) {
|
|
156517
156671
|
if (options.noEmit) {
|
|
@@ -156851,6 +157005,291 @@ ${lanes.join("\n")}
|
|
|
156851
157005
|
}
|
|
156852
157006
|
Debug.fail("should never ask for module name at index higher than possible module name");
|
|
156853
157007
|
}
|
|
157008
|
+
function createProgramDiagnostics(getCompilerOptionsObjectLiteralSyntax) {
|
|
157009
|
+
let computedDiagnostics;
|
|
157010
|
+
let fileReasons = createMultiMap();
|
|
157011
|
+
let fileProcessingDiagnostics;
|
|
157012
|
+
let commonSourceDirectory;
|
|
157013
|
+
let configDiagnostics;
|
|
157014
|
+
let lazyConfigDiagnostics;
|
|
157015
|
+
let fileReasonsToChain;
|
|
157016
|
+
let reasonToRelatedInfo;
|
|
157017
|
+
return {
|
|
157018
|
+
addConfigDiagnostic(diag2) {
|
|
157019
|
+
Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics");
|
|
157020
|
+
(configDiagnostics ?? (configDiagnostics = createDiagnosticCollection())).add(diag2);
|
|
157021
|
+
},
|
|
157022
|
+
addLazyConfigDiagnostic(file, message2, ...args) {
|
|
157023
|
+
Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics");
|
|
157024
|
+
(lazyConfigDiagnostics ?? (lazyConfigDiagnostics = [])).push({ file, diagnostic: message2, args });
|
|
157025
|
+
},
|
|
157026
|
+
addFileProcessingDiagnostic(diag2) {
|
|
157027
|
+
Debug.assert(computedDiagnostics === void 0, "Cannot modify program diagnostic state after requesting combined diagnostics");
|
|
157028
|
+
(fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push(diag2);
|
|
157029
|
+
},
|
|
157030
|
+
setCommonSourceDirectory(directory) {
|
|
157031
|
+
commonSourceDirectory = directory;
|
|
157032
|
+
},
|
|
157033
|
+
reuseStateFromOldProgram(oldProgramDiagnostics, isConfigIdentical) {
|
|
157034
|
+
fileReasons = oldProgramDiagnostics.getFileReasons();
|
|
157035
|
+
fileProcessingDiagnostics = oldProgramDiagnostics.getFileProcessingDiagnostics();
|
|
157036
|
+
if (isConfigIdentical) {
|
|
157037
|
+
commonSourceDirectory = oldProgramDiagnostics.getCommonSourceDirectory();
|
|
157038
|
+
configDiagnostics = oldProgramDiagnostics.getConfigDiagnostics();
|
|
157039
|
+
lazyConfigDiagnostics = oldProgramDiagnostics.getLazyConfigDiagnostics();
|
|
157040
|
+
}
|
|
157041
|
+
},
|
|
157042
|
+
getFileProcessingDiagnostics() {
|
|
157043
|
+
return fileProcessingDiagnostics;
|
|
157044
|
+
},
|
|
157045
|
+
getFileReasons() {
|
|
157046
|
+
return fileReasons;
|
|
157047
|
+
},
|
|
157048
|
+
getCommonSourceDirectory() {
|
|
157049
|
+
return commonSourceDirectory;
|
|
157050
|
+
},
|
|
157051
|
+
getConfigDiagnostics() {
|
|
157052
|
+
return configDiagnostics;
|
|
157053
|
+
},
|
|
157054
|
+
getLazyConfigDiagnostics() {
|
|
157055
|
+
return lazyConfigDiagnostics;
|
|
157056
|
+
},
|
|
157057
|
+
getCombinedDiagnostics(program) {
|
|
157058
|
+
if (computedDiagnostics) {
|
|
157059
|
+
return computedDiagnostics;
|
|
157060
|
+
}
|
|
157061
|
+
computedDiagnostics = createDiagnosticCollection();
|
|
157062
|
+
configDiagnostics == null ? void 0 : configDiagnostics.getDiagnostics().forEach((d) => computedDiagnostics.add(d));
|
|
157063
|
+
fileProcessingDiagnostics == null ? void 0 : fileProcessingDiagnostics.forEach((diagnostic) => {
|
|
157064
|
+
switch (diagnostic.kind) {
|
|
157065
|
+
case 1:
|
|
157066
|
+
return computedDiagnostics.add(
|
|
157067
|
+
createDiagnosticExplainingFile(
|
|
157068
|
+
program,
|
|
157069
|
+
diagnostic.file && program.getSourceFileByPath(diagnostic.file),
|
|
157070
|
+
diagnostic.fileProcessingReason,
|
|
157071
|
+
diagnostic.diagnostic,
|
|
157072
|
+
diagnostic.args || emptyArray
|
|
157073
|
+
)
|
|
157074
|
+
);
|
|
157075
|
+
case 0:
|
|
157076
|
+
return computedDiagnostics.add(filePreprocessingLibreferenceDiagnostic(program, diagnostic));
|
|
157077
|
+
case 2:
|
|
157078
|
+
return diagnostic.diagnostics.forEach((d) => computedDiagnostics.add(d));
|
|
157079
|
+
default:
|
|
157080
|
+
Debug.assertNever(diagnostic);
|
|
157081
|
+
}
|
|
157082
|
+
});
|
|
157083
|
+
lazyConfigDiagnostics == null ? void 0 : lazyConfigDiagnostics.forEach(
|
|
157084
|
+
({ file, diagnostic, args }) => computedDiagnostics.add(
|
|
157085
|
+
createDiagnosticExplainingFile(
|
|
157086
|
+
program,
|
|
157087
|
+
file,
|
|
157088
|
+
/*fileProcessingReason*/
|
|
157089
|
+
void 0,
|
|
157090
|
+
diagnostic,
|
|
157091
|
+
args
|
|
157092
|
+
)
|
|
157093
|
+
)
|
|
157094
|
+
);
|
|
157095
|
+
fileReasonsToChain = void 0;
|
|
157096
|
+
reasonToRelatedInfo = void 0;
|
|
157097
|
+
return computedDiagnostics;
|
|
157098
|
+
}
|
|
157099
|
+
};
|
|
157100
|
+
function filePreprocessingLibreferenceDiagnostic(program, { reason }) {
|
|
157101
|
+
const { file, pos, end } = getReferencedFileLocation(program, reason);
|
|
157102
|
+
const libReference = file.libReferenceDirectives[reason.index];
|
|
157103
|
+
const libName = getLibNameFromLibReference(libReference);
|
|
157104
|
+
const unqualifiedLibName = removeSuffix(removePrefix(libName, "lib."), ".d.ts");
|
|
157105
|
+
const suggestion = getSpellingSuggestion(unqualifiedLibName, libs, identity);
|
|
157106
|
+
return createFileDiagnostic(
|
|
157107
|
+
file,
|
|
157108
|
+
Debug.checkDefined(pos),
|
|
157109
|
+
Debug.checkDefined(end) - pos,
|
|
157110
|
+
suggestion ? Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1 : Diagnostics.Cannot_find_lib_definition_for_0,
|
|
157111
|
+
libName,
|
|
157112
|
+
suggestion
|
|
157113
|
+
);
|
|
157114
|
+
}
|
|
157115
|
+
function createDiagnosticExplainingFile(program, file, fileProcessingReason, diagnostic, args) {
|
|
157116
|
+
let seenReasons;
|
|
157117
|
+
let fileIncludeReasons;
|
|
157118
|
+
let relatedInfo;
|
|
157119
|
+
let fileIncludeReasonDetails;
|
|
157120
|
+
let redirectInfo;
|
|
157121
|
+
let chain;
|
|
157122
|
+
const reasons = file && fileReasons.get(file.path);
|
|
157123
|
+
let locationReason = isReferencedFile(fileProcessingReason) ? fileProcessingReason : void 0;
|
|
157124
|
+
let cachedChain = file && (fileReasonsToChain == null ? void 0 : fileReasonsToChain.get(file.path));
|
|
157125
|
+
if (cachedChain) {
|
|
157126
|
+
if (cachedChain.fileIncludeReasonDetails) {
|
|
157127
|
+
seenReasons = new Set(reasons);
|
|
157128
|
+
reasons == null ? void 0 : reasons.forEach(populateRelatedInfo);
|
|
157129
|
+
} else {
|
|
157130
|
+
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
157131
|
+
}
|
|
157132
|
+
redirectInfo = cachedChain.redirectInfo;
|
|
157133
|
+
} else {
|
|
157134
|
+
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
157135
|
+
redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file, program.getCompilerOptionsForFile(file));
|
|
157136
|
+
}
|
|
157137
|
+
if (fileProcessingReason) processReason(fileProcessingReason);
|
|
157138
|
+
const processedExtraReason = (seenReasons == null ? void 0 : seenReasons.size) !== (reasons == null ? void 0 : reasons.length);
|
|
157139
|
+
if (locationReason && (seenReasons == null ? void 0 : seenReasons.size) === 1) seenReasons = void 0;
|
|
157140
|
+
if (seenReasons && cachedChain) {
|
|
157141
|
+
if (cachedChain.details && !processedExtraReason) {
|
|
157142
|
+
chain = chainDiagnosticMessages(cachedChain.details, diagnostic, ...args ?? emptyArray);
|
|
157143
|
+
} else if (cachedChain.fileIncludeReasonDetails) {
|
|
157144
|
+
if (!processedExtraReason) {
|
|
157145
|
+
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
157146
|
+
fileIncludeReasonDetails = cachedChain.fileIncludeReasonDetails;
|
|
157147
|
+
} else {
|
|
157148
|
+
fileIncludeReasons = cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length);
|
|
157149
|
+
}
|
|
157150
|
+
} else {
|
|
157151
|
+
if (!cachedFileIncludeDetailsHasProcessedExtraReason()) {
|
|
157152
|
+
fileIncludeReasons = [...cachedChain.fileIncludeReasonDetails.next, fileIncludeReasons[0]];
|
|
157153
|
+
} else {
|
|
157154
|
+
fileIncludeReasons = append(cachedChain.fileIncludeReasonDetails.next.slice(0, reasons.length), fileIncludeReasons[0]);
|
|
157155
|
+
}
|
|
157156
|
+
}
|
|
157157
|
+
}
|
|
157158
|
+
}
|
|
157159
|
+
if (!chain) {
|
|
157160
|
+
if (!fileIncludeReasonDetails) fileIncludeReasonDetails = seenReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
|
157161
|
+
chain = chainDiagnosticMessages(
|
|
157162
|
+
redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails,
|
|
157163
|
+
diagnostic,
|
|
157164
|
+
...args || emptyArray
|
|
157165
|
+
);
|
|
157166
|
+
}
|
|
157167
|
+
if (file) {
|
|
157168
|
+
if (cachedChain) {
|
|
157169
|
+
if (!cachedChain.fileIncludeReasonDetails || !processedExtraReason && fileIncludeReasonDetails) {
|
|
157170
|
+
cachedChain.fileIncludeReasonDetails = fileIncludeReasonDetails;
|
|
157171
|
+
}
|
|
157172
|
+
} else {
|
|
157173
|
+
(fileReasonsToChain ?? (fileReasonsToChain = /* @__PURE__ */ new Map())).set(file.path, cachedChain = { fileIncludeReasonDetails, redirectInfo });
|
|
157174
|
+
}
|
|
157175
|
+
if (!cachedChain.details && !processedExtraReason) cachedChain.details = chain.next;
|
|
157176
|
+
}
|
|
157177
|
+
const location = locationReason && getReferencedFileLocation(program, locationReason);
|
|
157178
|
+
return location && isReferenceFileLocation(location) ? createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) : createCompilerDiagnosticFromMessageChain(chain, relatedInfo);
|
|
157179
|
+
function processReason(reason) {
|
|
157180
|
+
if (seenReasons == null ? void 0 : seenReasons.has(reason)) return;
|
|
157181
|
+
(seenReasons ?? (seenReasons = /* @__PURE__ */ new Set())).add(reason);
|
|
157182
|
+
(fileIncludeReasons ?? (fileIncludeReasons = [])).push(fileIncludeReasonToDiagnostics(program, reason));
|
|
157183
|
+
populateRelatedInfo(reason);
|
|
157184
|
+
}
|
|
157185
|
+
function populateRelatedInfo(reason) {
|
|
157186
|
+
if (!locationReason && isReferencedFile(reason)) {
|
|
157187
|
+
locationReason = reason;
|
|
157188
|
+
} else if (locationReason !== reason) {
|
|
157189
|
+
relatedInfo = append(relatedInfo, getFileIncludeReasonToRelatedInformation(program, reason));
|
|
157190
|
+
}
|
|
157191
|
+
}
|
|
157192
|
+
function cachedFileIncludeDetailsHasProcessedExtraReason() {
|
|
157193
|
+
var _a2;
|
|
157194
|
+
return ((_a2 = cachedChain.fileIncludeReasonDetails.next) == null ? void 0 : _a2.length) !== (reasons == null ? void 0 : reasons.length);
|
|
157195
|
+
}
|
|
157196
|
+
}
|
|
157197
|
+
function getFileIncludeReasonToRelatedInformation(program, reason) {
|
|
157198
|
+
let relatedInfo = reasonToRelatedInfo == null ? void 0 : reasonToRelatedInfo.get(reason);
|
|
157199
|
+
if (relatedInfo === void 0) (reasonToRelatedInfo ?? (reasonToRelatedInfo = /* @__PURE__ */ new Map())).set(reason, relatedInfo = fileIncludeReasonToRelatedInformation(program, reason) ?? false);
|
|
157200
|
+
return relatedInfo || void 0;
|
|
157201
|
+
}
|
|
157202
|
+
function fileIncludeReasonToRelatedInformation(program, reason) {
|
|
157203
|
+
if (isReferencedFile(reason)) {
|
|
157204
|
+
const referenceLocation = getReferencedFileLocation(program, reason);
|
|
157205
|
+
let message22;
|
|
157206
|
+
switch (reason.kind) {
|
|
157207
|
+
case 3:
|
|
157208
|
+
message22 = Diagnostics.File_is_included_via_import_here;
|
|
157209
|
+
break;
|
|
157210
|
+
case 4:
|
|
157211
|
+
message22 = Diagnostics.File_is_included_via_reference_here;
|
|
157212
|
+
break;
|
|
157213
|
+
case 5:
|
|
157214
|
+
message22 = Diagnostics.File_is_included_via_type_library_reference_here;
|
|
157215
|
+
break;
|
|
157216
|
+
case 7:
|
|
157217
|
+
message22 = Diagnostics.File_is_included_via_library_reference_here;
|
|
157218
|
+
break;
|
|
157219
|
+
default:
|
|
157220
|
+
Debug.assertNever(reason);
|
|
157221
|
+
}
|
|
157222
|
+
return isReferenceFileLocation(referenceLocation) ? createFileDiagnostic(
|
|
157223
|
+
referenceLocation.file,
|
|
157224
|
+
referenceLocation.pos,
|
|
157225
|
+
referenceLocation.end - referenceLocation.pos,
|
|
157226
|
+
message22
|
|
157227
|
+
) : void 0;
|
|
157228
|
+
}
|
|
157229
|
+
const currentDirectory = program.getCurrentDirectory();
|
|
157230
|
+
const rootNames = program.getRootFileNames();
|
|
157231
|
+
const options = program.getCompilerOptions();
|
|
157232
|
+
if (!options.configFile) return void 0;
|
|
157233
|
+
let configFileNode;
|
|
157234
|
+
let message2;
|
|
157235
|
+
switch (reason.kind) {
|
|
157236
|
+
case 0:
|
|
157237
|
+
if (!options.configFile.configFileSpecs) return void 0;
|
|
157238
|
+
const fileName = getNormalizedAbsolutePath(rootNames[reason.index], currentDirectory);
|
|
157239
|
+
const matchedByFiles = getMatchedFileSpec(program, fileName);
|
|
157240
|
+
if (matchedByFiles) {
|
|
157241
|
+
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles);
|
|
157242
|
+
message2 = Diagnostics.File_is_matched_by_files_list_specified_here;
|
|
157243
|
+
break;
|
|
157244
|
+
}
|
|
157245
|
+
const matchedByInclude = getMatchedIncludeSpec(program, fileName);
|
|
157246
|
+
if (!matchedByInclude || !isString(matchedByInclude)) return void 0;
|
|
157247
|
+
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
|
|
157248
|
+
message2 = Diagnostics.File_is_matched_by_include_pattern_specified_here;
|
|
157249
|
+
break;
|
|
157250
|
+
case 1:
|
|
157251
|
+
case 2:
|
|
157252
|
+
const resolvedProjectReferences = program.getResolvedProjectReferences();
|
|
157253
|
+
const projectReferences = program.getProjectReferences();
|
|
157254
|
+
const referencedResolvedRef = Debug.checkDefined(resolvedProjectReferences == null ? void 0 : resolvedProjectReferences[reason.index]);
|
|
157255
|
+
const referenceInfo = forEachProjectReference(
|
|
157256
|
+
projectReferences,
|
|
157257
|
+
resolvedProjectReferences,
|
|
157258
|
+
(resolvedRef, parent2, index2) => resolvedRef === referencedResolvedRef ? { sourceFile: (parent2 == null ? void 0 : parent2.sourceFile) || options.configFile, index: index2 } : void 0
|
|
157259
|
+
);
|
|
157260
|
+
if (!referenceInfo) return void 0;
|
|
157261
|
+
const { sourceFile, index } = referenceInfo;
|
|
157262
|
+
const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0);
|
|
157263
|
+
return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(
|
|
157264
|
+
sourceFile,
|
|
157265
|
+
referencesSyntax.elements[index],
|
|
157266
|
+
reason.kind === 2 ? Diagnostics.File_is_output_from_referenced_project_specified_here : Diagnostics.File_is_source_from_referenced_project_specified_here
|
|
157267
|
+
) : void 0;
|
|
157268
|
+
case 8:
|
|
157269
|
+
if (!options.types) return void 0;
|
|
157270
|
+
configFileNode = getOptionsSyntaxByArrayElementValue(getCompilerOptionsObjectLiteralSyntax(), "types", reason.typeReference);
|
|
157271
|
+
message2 = Diagnostics.File_is_entry_point_of_type_library_specified_here;
|
|
157272
|
+
break;
|
|
157273
|
+
case 6:
|
|
157274
|
+
if (reason.index !== void 0) {
|
|
157275
|
+
configFileNode = getOptionsSyntaxByArrayElementValue(getCompilerOptionsObjectLiteralSyntax(), "lib", options.lib[reason.index]);
|
|
157276
|
+
message2 = Diagnostics.File_is_library_specified_here;
|
|
157277
|
+
break;
|
|
157278
|
+
}
|
|
157279
|
+
const target = getNameOfScriptTarget(getEmitScriptTarget(options));
|
|
157280
|
+
configFileNode = target ? getOptionsSyntaxByValue(getCompilerOptionsObjectLiteralSyntax(), "target", target) : void 0;
|
|
157281
|
+
message2 = Diagnostics.File_is_default_library_for_target_specified_here;
|
|
157282
|
+
break;
|
|
157283
|
+
default:
|
|
157284
|
+
Debug.assertNever(reason);
|
|
157285
|
+
}
|
|
157286
|
+
return configFileNode && createDiagnosticForNodeInSourceFile(
|
|
157287
|
+
options.configFile,
|
|
157288
|
+
configFileNode,
|
|
157289
|
+
message2
|
|
157290
|
+
);
|
|
157291
|
+
}
|
|
157292
|
+
}
|
|
156854
157293
|
function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers, forceDtsEmit) {
|
|
156855
157294
|
const outputFiles = [];
|
|
156856
157295
|
const { emitSkipped, diagnostics } = program.emit(sourceFile, writeFile22, cancellationToken, emitOnlyDtsFiles, customTransformers, forceDtsEmit);
|
|
@@ -164658,9 +165097,11 @@ ${lanes.join("\n")}
|
|
|
164658
165097
|
if (!resolver.canReuseTypeNode(context, node)) {
|
|
164659
165098
|
return resolver.serializeExistingTypeNode(context, node);
|
|
164660
165099
|
}
|
|
165100
|
+
const specifier = rewriteModuleSpecifier2(node, node.argument.literal);
|
|
165101
|
+
const literal = specifier === node.argument.literal ? reuseNode(context, node.argument.literal) : specifier;
|
|
164661
165102
|
return factory.updateImportTypeNode(
|
|
164662
165103
|
node,
|
|
164663
|
-
|
|
165104
|
+
literal === node.argument.literal ? reuseNode(context, node.argument) : factory.createLiteralTypeNode(literal),
|
|
164664
165105
|
visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes),
|
|
164665
165106
|
visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName),
|
|
164666
165107
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
@@ -164821,10 +165262,7 @@ ${lanes.join("\n")}
|
|
|
164821
165262
|
}
|
|
164822
165263
|
function rewriteModuleSpecifier2(parent2, lit) {
|
|
164823
165264
|
const newName = resolver.getModuleSpecifierOverride(context, parent2, lit);
|
|
164824
|
-
|
|
164825
|
-
return setOriginalNode(factory.createStringLiteral(newName), lit);
|
|
164826
|
-
}
|
|
164827
|
-
return visitNode(lit, visitExistingNodeTreeSymbols, isStringLiteral);
|
|
165265
|
+
return newName ? setOriginalNode(factory.createStringLiteral(newName), lit) : lit;
|
|
164828
165266
|
}
|
|
164829
165267
|
}
|
|
164830
165268
|
}
|
|
@@ -164997,12 +165435,7 @@ ${lanes.join("\n")}
|
|
|
164997
165435
|
return withNewScope(context, node, () => serializeTypeAnnotationOfDeclaration(accessorType, context, node, symbol) ?? inferTypeOfDeclaration(node, symbol, context));
|
|
164998
165436
|
}
|
|
164999
165437
|
if (accessorDeclarations.getAccessor) {
|
|
165000
|
-
return withNewScope(context, accessorDeclarations.getAccessor, () => createReturnFromSignature(
|
|
165001
|
-
accessorDeclarations.getAccessor,
|
|
165002
|
-
/*symbol*/
|
|
165003
|
-
void 0,
|
|
165004
|
-
context
|
|
165005
|
-
));
|
|
165438
|
+
return withNewScope(context, accessorDeclarations.getAccessor, () => createReturnFromSignature(accessorDeclarations.getAccessor, symbol, context));
|
|
165006
165439
|
}
|
|
165007
165440
|
return void 0;
|
|
165008
165441
|
}
|
|
@@ -165121,7 +165554,7 @@ ${lanes.join("\n")}
|
|
|
165121
165554
|
/* AnyKeyword */
|
|
165122
165555
|
);
|
|
165123
165556
|
}
|
|
165124
|
-
function inferReturnTypeOfSignatureSignature(node, context, reportFallback) {
|
|
165557
|
+
function inferReturnTypeOfSignatureSignature(node, context, symbol, reportFallback) {
|
|
165125
165558
|
if (reportFallback) {
|
|
165126
165559
|
context.tracker.reportInferenceFallback(node);
|
|
165127
165560
|
}
|
|
@@ -165131,7 +165564,7 @@ ${lanes.join("\n")}
|
|
|
165131
165564
|
/* AnyKeyword */
|
|
165132
165565
|
);
|
|
165133
165566
|
}
|
|
165134
|
-
return resolver.serializeReturnTypeForSignature(context, node) ?? factory.createKeywordTypeNode(
|
|
165567
|
+
return resolver.serializeReturnTypeForSignature(context, node, symbol) ?? factory.createKeywordTypeNode(
|
|
165135
165568
|
133
|
|
165136
165569
|
/* AnyKeyword */
|
|
165137
165570
|
);
|
|
@@ -165258,18 +165691,21 @@ ${lanes.join("\n")}
|
|
|
165258
165691
|
return failed;
|
|
165259
165692
|
}
|
|
165260
165693
|
function typeFromFunctionLikeExpression(fnNode, context) {
|
|
165261
|
-
const
|
|
165262
|
-
context.noInferenceFallback = true;
|
|
165263
|
-
createReturnFromSignature(
|
|
165694
|
+
const returnType = createReturnFromSignature(
|
|
165264
165695
|
fnNode,
|
|
165265
165696
|
/*symbol*/
|
|
165266
165697
|
void 0,
|
|
165267
165698
|
context
|
|
165268
165699
|
);
|
|
165269
|
-
reuseTypeParameters(fnNode.typeParameters, context);
|
|
165270
|
-
fnNode.parameters.map((p) => ensureParameter(p, context));
|
|
165271
|
-
|
|
165272
|
-
|
|
165700
|
+
const typeParameters = reuseTypeParameters(fnNode.typeParameters, context);
|
|
165701
|
+
const parameters = fnNode.parameters.map((p) => ensureParameter(p, context));
|
|
165702
|
+
return syntacticResult(
|
|
165703
|
+
factory.createFunctionTypeNode(
|
|
165704
|
+
typeParameters,
|
|
165705
|
+
parameters,
|
|
165706
|
+
returnType
|
|
165707
|
+
)
|
|
165708
|
+
);
|
|
165273
165709
|
}
|
|
165274
165710
|
function canGetTypeFromArrayLiteral(arrayLiteral, context, isConstContext) {
|
|
165275
165711
|
if (!isConstContext) {
|
|
@@ -165443,18 +165879,17 @@ ${lanes.join("\n")}
|
|
|
165443
165879
|
);
|
|
165444
165880
|
}
|
|
165445
165881
|
function reuseTypeParameters(typeParameters, context) {
|
|
165446
|
-
return typeParameters == null ? void 0 : typeParameters.map(
|
|
165447
|
-
|
|
165448
|
-
|
|
165449
|
-
|
|
165450
|
-
|
|
165451
|
-
|
|
165452
|
-
|
|
165453
|
-
|
|
165454
|
-
|
|
165455
|
-
|
|
165456
|
-
|
|
165457
|
-
);
|
|
165882
|
+
return typeParameters == null ? void 0 : typeParameters.map((tp) => {
|
|
165883
|
+
var _a2;
|
|
165884
|
+
const { node: tpName } = resolver.trackExistingEntityName(context, tp.name);
|
|
165885
|
+
return factory.updateTypeParameterDeclaration(
|
|
165886
|
+
tp,
|
|
165887
|
+
(_a2 = tp.modifiers) == null ? void 0 : _a2.map((m) => reuseNode(context, m)),
|
|
165888
|
+
tpName,
|
|
165889
|
+
serializeExistingTypeNodeWithFallback(tp.constraint, context),
|
|
165890
|
+
serializeExistingTypeNodeWithFallback(tp.default, context)
|
|
165891
|
+
);
|
|
165892
|
+
});
|
|
165458
165893
|
}
|
|
165459
165894
|
function typeFromObjectLiteralMethod(method, name, context, isConstContext) {
|
|
165460
165895
|
const returnType = createReturnFromSignature(
|
|
@@ -165607,7 +166042,7 @@ ${lanes.join("\n")}
|
|
|
165607
166042
|
} else if (isValueSignatureDeclaration(fn)) {
|
|
165608
166043
|
returnType = typeFromSingleReturnExpression(fn, context);
|
|
165609
166044
|
}
|
|
165610
|
-
return returnType.type !== void 0 ? returnType.type : inferReturnTypeOfSignatureSignature(fn, context, reportFallback && returnType.reportFallback && !returnTypeNode);
|
|
166045
|
+
return returnType.type !== void 0 ? returnType.type : inferReturnTypeOfSignatureSignature(fn, context, symbol, reportFallback && returnType.reportFallback && !returnTypeNode);
|
|
165611
166046
|
}
|
|
165612
166047
|
function typeFromSingleReturnExpression(declaration, context) {
|
|
165613
166048
|
let candidateExpr;
|
|
@@ -168992,7 +169427,7 @@ ${lanes.join("\n")}
|
|
|
168992
169427
|
return moduleSpecifierToValidIdentifier(removeFileExtension(stripQuotes2(moduleSymbol.name)), target, forceCapitalize);
|
|
168993
169428
|
}
|
|
168994
169429
|
function moduleSpecifierToValidIdentifier(moduleSpecifier, target, forceCapitalize) {
|
|
168995
|
-
const baseName = getBaseFileName(removeSuffix(moduleSpecifier, "/index"));
|
|
169430
|
+
const baseName = getBaseFileName(removeSuffix(removeFileExtension(moduleSpecifier), "/index"));
|
|
168996
169431
|
let res = "";
|
|
168997
169432
|
let lastCharWasValid = true;
|
|
168998
169433
|
const firstCharCode = baseName.charCodeAt(0);
|
|
@@ -175153,7 +175588,7 @@ interface Symbol {
|
|
|
175153
175588
|
const unusedImportsFromOldFile = /* @__PURE__ */ new Set();
|
|
175154
175589
|
for (const statement of toMove) {
|
|
175155
175590
|
forEachReference(statement, checker, enclosingRange, (symbol, isValidTypeOnlyUseSite) => {
|
|
175156
|
-
if (!symbol.declarations) {
|
|
175591
|
+
if (!some(symbol.declarations)) {
|
|
175157
175592
|
return;
|
|
175158
175593
|
}
|
|
175159
175594
|
if (existingTargetLocals.has(skipAlias(symbol, checker))) {
|
|
@@ -185945,6 +186380,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
185945
186380
|
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,
|
|
185946
186381
|
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code,
|
|
185947
186382
|
Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,
|
|
186383
|
+
Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code,
|
|
185948
186384
|
Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found.code
|
|
185949
186385
|
];
|
|
185950
186386
|
registerCodeFix({
|
|
@@ -187060,6 +187496,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
187060
187496
|
case 200:
|
|
187061
187497
|
return 2;
|
|
187062
187498
|
case 100:
|
|
187499
|
+
case 101:
|
|
187063
187500
|
case 199:
|
|
187064
187501
|
return getImpliedNodeFormatForEmit(importingFile, program) === 99 ? 2 : 3;
|
|
187065
187502
|
default:
|
|
@@ -188486,7 +188923,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188486
188923
|
Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,
|
|
188487
188924
|
Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,
|
|
188488
188925
|
Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
|
|
188489
|
-
Diagnostics.Cannot_find_name_0.code
|
|
188926
|
+
Diagnostics.Cannot_find_name_0.code,
|
|
188927
|
+
Diagnostics.Type_0_does_not_satisfy_the_expected_type_1.code
|
|
188490
188928
|
];
|
|
188491
188929
|
registerCodeFix({
|
|
188492
188930
|
errorCodes: errorCodes28,
|
|
@@ -188523,9 +188961,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188523
188961
|
return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
|
|
188524
188962
|
eachDiagnostic(context, errorCodes28, (diag2) => {
|
|
188525
188963
|
const info = getInfo10(diag2.file, diag2.start, diag2.code, checker, context.program);
|
|
188526
|
-
if (
|
|
188527
|
-
|
|
188528
|
-
|
|
188964
|
+
if (info === void 0) return;
|
|
188965
|
+
const nodeId = getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 ? info.identifier || getNodeId(info.token) : info.token.text);
|
|
188966
|
+
if (!addToSeen(seen, nodeId)) return;
|
|
188529
188967
|
if (fixId56 === fixMissingFunctionDeclaration && (info.kind === 2 || info.kind === 5)) {
|
|
188530
188968
|
addFunctionDeclaration(changes, context, info);
|
|
188531
188969
|
} else if (fixId56 === fixMissingProperties && info.kind === 3) {
|
|
@@ -188577,7 +189015,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188577
189015
|
}
|
|
188578
189016
|
});
|
|
188579
189017
|
function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
|
|
188580
|
-
var _a2, _b2
|
|
189018
|
+
var _a2, _b2;
|
|
188581
189019
|
const token = getTokenAtPosition(sourceFile, tokenPos);
|
|
188582
189020
|
const parent2 = token.parent;
|
|
188583
189021
|
if (errorCode === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) {
|
|
@@ -188599,23 +189037,25 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188599
189037
|
if (!length(properties)) return void 0;
|
|
188600
189038
|
return { kind: 3, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent2 };
|
|
188601
189039
|
}
|
|
188602
|
-
if (token.kind === 19
|
|
188603
|
-
const
|
|
188604
|
-
|
|
188605
|
-
checker.
|
|
188606
|
-
|
|
188607
|
-
|
|
188608
|
-
|
|
188609
|
-
|
|
188610
|
-
|
|
188611
|
-
|
|
188612
|
-
|
|
188613
|
-
|
|
188614
|
-
|
|
189040
|
+
if (token.kind === 19 || isSatisfiesExpression(parent2) || isReturnStatement(parent2)) {
|
|
189041
|
+
const expression = (isSatisfiesExpression(parent2) || isReturnStatement(parent2)) && parent2.expression ? parent2.expression : parent2;
|
|
189042
|
+
if (isObjectLiteralExpression(expression)) {
|
|
189043
|
+
const targetType = isSatisfiesExpression(parent2) ? checker.getTypeFromTypeNode(parent2.type) : checker.getContextualType(expression) || checker.getTypeAtLocation(expression);
|
|
189044
|
+
const properties = arrayFrom(checker.getUnmatchedProperties(
|
|
189045
|
+
checker.getTypeAtLocation(parent2),
|
|
189046
|
+
targetType.getNonNullableType(),
|
|
189047
|
+
/*requireOptionalProperties*/
|
|
189048
|
+
false,
|
|
189049
|
+
/*matchDiscriminantProperties*/
|
|
189050
|
+
false
|
|
189051
|
+
));
|
|
189052
|
+
if (!length(properties)) return void 0;
|
|
189053
|
+
return { kind: 3, token: parent2, identifier: void 0, properties, parentDeclaration: expression, indentation: isReturnStatement(expression.parent) || isYieldExpression(expression.parent) ? 0 : void 0 };
|
|
189054
|
+
}
|
|
188615
189055
|
}
|
|
188616
189056
|
if (!isMemberName(token)) return void 0;
|
|
188617
189057
|
if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) {
|
|
188618
|
-
const targetType = (
|
|
189058
|
+
const targetType = (_a2 = checker.getContextualType(token) || checker.getTypeAtLocation(token)) == null ? void 0 : _a2.getNonNullableType();
|
|
188619
189059
|
const properties = arrayFrom(checker.getUnmatchedProperties(
|
|
188620
189060
|
checker.getTypeAtLocation(parent2.initializer),
|
|
188621
189061
|
targetType,
|
|
@@ -188634,7 +189074,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
188634
189074
|
return { kind: 4, token, attributes, parentDeclaration: token.parent };
|
|
188635
189075
|
}
|
|
188636
189076
|
if (isIdentifier(token)) {
|
|
188637
|
-
const type = (
|
|
189077
|
+
const type = (_b2 = checker.getContextualType(token)) == null ? void 0 : _b2.getNonNullableType();
|
|
188638
189078
|
if (type && getObjectFlags(type) & 16) {
|
|
188639
189079
|
const signature = firstOrUndefined(checker.getSignaturesOfType(
|
|
188640
189080
|
type,
|
|
@@ -189676,9 +190116,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
189676
190116
|
}
|
|
189677
190117
|
registerCodeFix({
|
|
189678
190118
|
errorCodes: [
|
|
189679
|
-
Diagnostics.
|
|
189680
|
-
Diagnostics.
|
|
189681
|
-
Diagnostics.
|
|
190119
|
+
Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
|
|
190120
|
+
Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,
|
|
190121
|
+
Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code
|
|
189682
190122
|
],
|
|
189683
190123
|
getCodeActions: function getCodeActionsToFixModuleAndTarget(context) {
|
|
189684
190124
|
const compilerOptions = context.program.getCompilerOptions();
|
|
@@ -190139,6 +190579,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
190139
190579
|
break;
|
|
190140
190580
|
} else if (canDeleteEntireVariableStatement(sourceFile, token)) {
|
|
190141
190581
|
deleteEntireVariableStatement(changes, sourceFile, token.parent);
|
|
190582
|
+
} else if (isIdentifier(token) && isFunctionDeclaration(token.parent)) {
|
|
190583
|
+
deleteFunctionLikeDeclaration(changes, sourceFile, token.parent);
|
|
190142
190584
|
} else {
|
|
190143
190585
|
tryDeleteDeclaration(
|
|
190144
190586
|
sourceFile,
|
|
@@ -193246,12 +193688,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
193246
193688
|
return typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget);
|
|
193247
193689
|
}
|
|
193248
193690
|
function typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget) {
|
|
193249
|
-
|
|
193250
|
-
|
|
193251
|
-
|
|
193252
|
-
|
|
193253
|
-
typeNode = importableReference.typeNode;
|
|
193254
|
-
}
|
|
193691
|
+
const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);
|
|
193692
|
+
if (importableReference) {
|
|
193693
|
+
importSymbols(importAdder, importableReference.symbols);
|
|
193694
|
+
typeNode = importableReference.typeNode;
|
|
193255
193695
|
}
|
|
193256
193696
|
return getSynthesizedDeepClone(typeNode);
|
|
193257
193697
|
}
|
|
@@ -202069,7 +202509,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202069
202509
|
} else {
|
|
202070
202510
|
addIfImplementation(body);
|
|
202071
202511
|
}
|
|
202072
|
-
} else if (isAssertionExpression(typeHavingNode)) {
|
|
202512
|
+
} else if (isAssertionExpression(typeHavingNode) || isSatisfiesExpression(typeHavingNode)) {
|
|
202073
202513
|
addIfImplementation(typeHavingNode.expression);
|
|
202074
202514
|
}
|
|
202075
202515
|
}
|
|
@@ -202537,7 +202977,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202537
202977
|
const { parent: parent2 } = node;
|
|
202538
202978
|
const typeChecker = program.getTypeChecker();
|
|
202539
202979
|
if (node.kind === 164 || isIdentifier(node) && isJSDocOverrideTag(parent2) && parent2.tagName === node) {
|
|
202540
|
-
|
|
202980
|
+
const def = getDefinitionFromOverriddenMember(typeChecker, node);
|
|
202981
|
+
if (def !== void 0 || node.kind !== 164) {
|
|
202982
|
+
return def || emptyArray;
|
|
202983
|
+
}
|
|
202541
202984
|
}
|
|
202542
202985
|
if (isJumpStatementTarget(node)) {
|
|
202543
202986
|
const label = getTargetLabel(node.parent, node.text);
|
|
@@ -202551,9 +202994,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202551
202994
|
)] : void 0;
|
|
202552
202995
|
}
|
|
202553
202996
|
switch (node.kind) {
|
|
202554
|
-
case 107:
|
|
202555
|
-
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
202556
|
-
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
202557
202997
|
case 90:
|
|
202558
202998
|
if (!isDefaultClause(node.parent)) {
|
|
202559
202999
|
break;
|
|
@@ -202566,19 +203006,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202566
203006
|
}
|
|
202567
203007
|
break;
|
|
202568
203008
|
}
|
|
202569
|
-
|
|
202570
|
-
|
|
202571
|
-
|
|
202572
|
-
|
|
202573
|
-
|
|
202574
|
-
|
|
202575
|
-
|
|
202576
|
-
|
|
202577
|
-
}
|
|
202578
|
-
if (node.kind === 127) {
|
|
202579
|
-
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
202580
|
-
const isGeneratorFunction = functionDeclaration && functionDeclaration.asteriskToken;
|
|
202581
|
-
return isGeneratorFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
203009
|
+
let findFunctionDecl;
|
|
203010
|
+
switch (node.kind) {
|
|
203011
|
+
case 107:
|
|
203012
|
+
case 135:
|
|
203013
|
+
case 127:
|
|
203014
|
+
findFunctionDecl = isFunctionLikeDeclaration;
|
|
203015
|
+
const functionDeclaration = findAncestor(node, findFunctionDecl);
|
|
203016
|
+
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
202582
203017
|
}
|
|
202583
203018
|
if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) {
|
|
202584
203019
|
const classDecl = node.parent.parent;
|
|
@@ -202628,6 +203063,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202628
203063
|
}];
|
|
202629
203064
|
}
|
|
202630
203065
|
}
|
|
203066
|
+
if (isModifier(node) && (isClassElement(parent2) || isNamedDeclaration(parent2))) {
|
|
203067
|
+
symbol = parent2.symbol;
|
|
203068
|
+
}
|
|
202631
203069
|
if (!symbol) {
|
|
202632
203070
|
return concatenate(fileReferenceDefinition, getDefinitionInfoForIndexSignatures(node, typeChecker));
|
|
202633
203071
|
}
|
|
@@ -202824,12 +203262,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
202824
203262
|
false
|
|
202825
203263
|
);
|
|
202826
203264
|
}
|
|
202827
|
-
|
|
203265
|
+
let { symbol, failedAliasResolution } = getSymbol(
|
|
202828
203266
|
node,
|
|
202829
203267
|
typeChecker,
|
|
202830
203268
|
/*stopAtAlias*/
|
|
202831
203269
|
false
|
|
202832
203270
|
);
|
|
203271
|
+
if (isModifier(node) && (isClassElement(node.parent) || isNamedDeclaration(node.parent))) {
|
|
203272
|
+
symbol = node.parent.symbol;
|
|
203273
|
+
failedAliasResolution = false;
|
|
203274
|
+
}
|
|
202833
203275
|
if (!symbol) return void 0;
|
|
202834
203276
|
const typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node);
|
|
202835
203277
|
const returnType = tryGetReturnTypeOfFunction(symbol, typeAtLocation, typeChecker);
|
|
@@ -203334,22 +203776,24 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
203334
203776
|
if (!signature) {
|
|
203335
203777
|
return;
|
|
203336
203778
|
}
|
|
203337
|
-
|
|
203338
|
-
|
|
203339
|
-
if (
|
|
203340
|
-
|
|
203341
|
-
}
|
|
203342
|
-
const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(param);
|
|
203343
|
-
if (effectiveTypeAnnotation) {
|
|
203344
|
-
continue;
|
|
203779
|
+
let pos = 0;
|
|
203780
|
+
for (const param of node.parameters) {
|
|
203781
|
+
if (isHintableDeclaration(param)) {
|
|
203782
|
+
addParameterTypeHint(param, parameterIsThisKeyword(param) ? signature.thisParameter : signature.parameters[pos]);
|
|
203345
203783
|
}
|
|
203346
|
-
|
|
203347
|
-
if (!typeHints) {
|
|
203784
|
+
if (parameterIsThisKeyword(param)) {
|
|
203348
203785
|
continue;
|
|
203349
203786
|
}
|
|
203350
|
-
|
|
203787
|
+
pos++;
|
|
203351
203788
|
}
|
|
203352
203789
|
}
|
|
203790
|
+
function addParameterTypeHint(node, symbol) {
|
|
203791
|
+
const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(node);
|
|
203792
|
+
if (effectiveTypeAnnotation || symbol === void 0) return;
|
|
203793
|
+
const typeHints = getParameterDeclarationTypeHints(symbol);
|
|
203794
|
+
if (typeHints === void 0) return;
|
|
203795
|
+
addTypeHints(typeHints, node.questionToken ? node.questionToken.end : node.name.end);
|
|
203796
|
+
}
|
|
203353
203797
|
function getParameterDeclarationTypeHints(symbol) {
|
|
203354
203798
|
const valueDeclaration = symbol.valueDeclaration;
|
|
203355
203799
|
if (!valueDeclaration || !isParameter(valueDeclaration)) {
|
|
@@ -213221,6 +213665,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
213221
213665
|
createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
|
|
213222
213666
|
createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
|
|
213223
213667
|
createProgram: () => createProgram,
|
|
213668
|
+
createProgramDiagnostics: () => createProgramDiagnostics,
|
|
213224
213669
|
createProgramHost: () => createProgramHost,
|
|
213225
213670
|
createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
|
|
213226
213671
|
createQueue: () => createQueue,
|
|
@@ -213390,6 +213835,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
213390
213835
|
forEachLeadingCommentRange: () => forEachLeadingCommentRange,
|
|
213391
213836
|
forEachNameInAccessChainWalkingLeft: () => forEachNameInAccessChainWalkingLeft,
|
|
213392
213837
|
forEachNameOfDefaultExport: () => forEachNameOfDefaultExport,
|
|
213838
|
+
forEachOptionsSyntaxByName: () => forEachOptionsSyntaxByName,
|
|
213839
|
+
forEachProjectReference: () => forEachProjectReference,
|
|
213393
213840
|
forEachPropertyAssignment: () => forEachPropertyAssignment,
|
|
213394
213841
|
forEachResolvedProjectReference: () => forEachResolvedProjectReference,
|
|
213395
213842
|
forEachReturnStatement: () => forEachReturnStatement,
|
|
@@ -213629,6 +214076,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
213629
214076
|
getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode,
|
|
213630
214077
|
getLeftmostAccessExpression: () => getLeftmostAccessExpression,
|
|
213631
214078
|
getLeftmostExpression: () => getLeftmostExpression,
|
|
214079
|
+
getLibFileNameFromLibReference: () => getLibFileNameFromLibReference,
|
|
214080
|
+
getLibNameFromLibReference: () => getLibNameFromLibReference,
|
|
213632
214081
|
getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName,
|
|
213633
214082
|
getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition,
|
|
213634
214083
|
getLineInfo: () => getLineInfo,
|
|
@@ -213701,6 +214150,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
213701
214150
|
getOptionFromName: () => getOptionFromName,
|
|
213702
214151
|
getOptionsForLibraryResolution: () => getOptionsForLibraryResolution,
|
|
213703
214152
|
getOptionsNameMap: () => getOptionsNameMap,
|
|
214153
|
+
getOptionsSyntaxByArrayElementValue: () => getOptionsSyntaxByArrayElementValue,
|
|
214154
|
+
getOptionsSyntaxByValue: () => getOptionsSyntaxByValue,
|
|
213704
214155
|
getOrCreateEmitNode: () => getOrCreateEmitNode,
|
|
213705
214156
|
getOrUpdate: () => getOrUpdate,
|
|
213706
214157
|
getOriginalNode: () => getOriginalNode,
|
|
@@ -213737,7 +214188,6 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
213737
214188
|
getPrivateIdentifier: () => getPrivateIdentifier,
|
|
213738
214189
|
getProperties: () => getProperties,
|
|
213739
214190
|
getProperty: () => getProperty,
|
|
213740
|
-
getPropertyArrayElementValue: () => getPropertyArrayElementValue,
|
|
213741
214191
|
getPropertyAssignmentAliasLikeExpression: () => getPropertyAssignmentAliasLikeExpression,
|
|
213742
214192
|
getPropertyNameForPropertyNameNode: () => getPropertyNameForPropertyNameNode,
|
|
213743
214193
|
getPropertyNameFromType: () => getPropertyNameFromType,
|
|
@@ -214648,6 +215098,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
214648
215098
|
moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
|
|
214649
215099
|
moduleSpecifierToValidIdentifier: () => moduleSpecifierToValidIdentifier,
|
|
214650
215100
|
moduleSpecifiers: () => ts_moduleSpecifiers_exports,
|
|
215101
|
+
moduleSupportsImportAttributes: () => moduleSupportsImportAttributes,
|
|
214651
215102
|
moduleSymbolToValidIdentifier: () => moduleSymbolToValidIdentifier,
|
|
214652
215103
|
moveEmitHelpers: () => moveEmitHelpers,
|
|
214653
215104
|
moveRangeEnd: () => moveRangeEnd,
|
|
@@ -216012,6 +216463,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
216012
216463
|
ModuleKind3["ES2022"] = "es2022";
|
|
216013
216464
|
ModuleKind3["ESNext"] = "esnext";
|
|
216014
216465
|
ModuleKind3["Node16"] = "node16";
|
|
216466
|
+
ModuleKind3["Node18"] = "node18";
|
|
216015
216467
|
ModuleKind3["NodeNext"] = "nodenext";
|
|
216016
216468
|
ModuleKind3["Preserve"] = "preserve";
|
|
216017
216469
|
return ModuleKind3;
|
|
@@ -226438,20 +226890,19 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
226438
226890
|
try {
|
|
226439
226891
|
codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file));
|
|
226440
226892
|
} catch (e) {
|
|
226893
|
+
const error2 = e instanceof Error ? e : new Error(e);
|
|
226441
226894
|
const ls = project.getLanguageService();
|
|
226442
226895
|
const existingDiagCodes = [
|
|
226443
226896
|
...ls.getSyntacticDiagnostics(file),
|
|
226444
226897
|
...ls.getSemanticDiagnostics(file),
|
|
226445
226898
|
...ls.getSuggestionDiagnostics(file)
|
|
226446
|
-
].map(
|
|
226447
|
-
(d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length) && d.code
|
|
226448
|
-
);
|
|
226899
|
+
].filter((d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length)).map((d) => d.code);
|
|
226449
226900
|
const badCode = args.errorCodes.find((c) => !existingDiagCodes.includes(c));
|
|
226450
226901
|
if (badCode !== void 0) {
|
|
226451
|
-
|
|
226452
|
-
${
|
|
226902
|
+
error2.message += `
|
|
226903
|
+
Additional information: BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")})`;
|
|
226453
226904
|
}
|
|
226454
|
-
throw
|
|
226905
|
+
throw error2;
|
|
226455
226906
|
}
|
|
226456
226907
|
return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions;
|
|
226457
226908
|
}
|
|
@@ -260921,13 +261372,13 @@ var require_git_raw_commits = __commonJS({
|
|
|
260921
261372
|
});
|
|
260922
261373
|
|
|
260923
261374
|
// node_modules/@commitlint/cli/lib/cli.js
|
|
260924
|
-
import { createRequire as createRequire4 } from "module";
|
|
260925
|
-
import path13 from "path";
|
|
260926
|
-
import { fileURLToPath as fileURLToPath9, pathToFileURL as pathToFileURL4 } from "url";
|
|
260927
|
-
import util2 from "util";
|
|
261375
|
+
import { createRequire as createRequire4 } from "node:module";
|
|
261376
|
+
import path13 from "node:path";
|
|
261377
|
+
import { fileURLToPath as fileURLToPath9, pathToFileURL as pathToFileURL4 } from "node:url";
|
|
261378
|
+
import util2 from "node:util";
|
|
260928
261379
|
|
|
260929
261380
|
// node_modules/@commitlint/lint/lib/lint.js
|
|
260930
|
-
import util from "util";
|
|
261381
|
+
import util from "node:util";
|
|
260931
261382
|
|
|
260932
261383
|
// node_modules/@commitlint/is-ignored/lib/defaults.js
|
|
260933
261384
|
var import_semver = __toESM(require_semver2(), 1);
|
|
@@ -260953,35 +261404,18 @@ var wildcards = [
|
|
|
260953
261404
|
test(/^Auto-merged (.*?) into (.*)/)
|
|
260954
261405
|
];
|
|
260955
261406
|
|
|
260956
|
-
// node_modules/@commitlint/is-ignored/lib/validate-ignore-func.js
|
|
260957
|
-
function validateIgnoreFunction(fn) {
|
|
260958
|
-
const fnString = fn.toString();
|
|
260959
|
-
const dangerousPattern = /(?:process|require|import|eval|fetch|XMLHttpRequest|fs|child_process)(?:\s*\.|\s*\()|(?:exec|execFile|spawn)\s*\(/;
|
|
260960
|
-
if (dangerousPattern.test(fnString)) {
|
|
260961
|
-
const match2 = fnString.match(dangerousPattern);
|
|
260962
|
-
throw new Error(`Ignore function contains forbidden pattern: ${match2?.[0].trim()}`);
|
|
260963
|
-
}
|
|
260964
|
-
}
|
|
260965
|
-
|
|
260966
261407
|
// node_modules/@commitlint/is-ignored/lib/is-ignored.js
|
|
260967
261408
|
function isIgnored(commit = "", opts = {}) {
|
|
260968
261409
|
const ignores = typeof opts.ignores === "undefined" ? [] : opts.ignores;
|
|
260969
261410
|
if (!Array.isArray(ignores)) {
|
|
260970
261411
|
throw new Error(`ignores must be of type array, received ${ignores} of type ${typeof ignores}`);
|
|
260971
261412
|
}
|
|
260972
|
-
ignores.forEach(validateIgnoreFunction);
|
|
260973
261413
|
const invalids = ignores.filter((c) => typeof c !== "function");
|
|
260974
261414
|
if (invalids.length > 0) {
|
|
260975
261415
|
throw new Error(`ignores must be array of type function, received items of type: ${invalids.map((i) => typeof i).join(", ")}`);
|
|
260976
261416
|
}
|
|
260977
261417
|
const base = opts.defaults === false ? [] : wildcards;
|
|
260978
|
-
return [...base, ...ignores].some((w) =>
|
|
260979
|
-
const result = w(commit);
|
|
260980
|
-
if (typeof result !== "boolean") {
|
|
260981
|
-
throw new Error(`Ignore function must return a boolean, received ${typeof result}`);
|
|
260982
|
-
}
|
|
260983
|
-
return result;
|
|
260984
|
-
});
|
|
261418
|
+
return [...base, ...ignores].some((w) => w(commit));
|
|
260985
261419
|
}
|
|
260986
261420
|
|
|
260987
261421
|
// node_modules/@commitlint/parse/lib/index.js
|
|
@@ -261304,24 +261738,17 @@ var headerMinLength = (parsed, _when = void 0, value2 = 0) => {
|
|
|
261304
261738
|
// node_modules/@commitlint/rules/lib/header-trim.js
|
|
261305
261739
|
var headerTrim = (parsed) => {
|
|
261306
261740
|
const { header } = parsed;
|
|
261307
|
-
if (!header)
|
|
261741
|
+
if (!header)
|
|
261308
261742
|
return [true];
|
|
261309
|
-
|
|
261310
|
-
const
|
|
261311
|
-
|
|
261312
|
-
|
|
261313
|
-
|
|
261314
|
-
|
|
261315
|
-
|
|
261316
|
-
|
|
261317
|
-
|
|
261318
|
-
case startsWithWhiteSpace:
|
|
261319
|
-
return [false, message(["header", "must not start with whitespace"])];
|
|
261320
|
-
case endsWithWhiteSpace:
|
|
261321
|
-
return [false, message(["header", "must not end with whitespace"])];
|
|
261322
|
-
default:
|
|
261323
|
-
return [true];
|
|
261324
|
-
}
|
|
261743
|
+
const startsWithWhiteSpace = header.length > header.trimStart().length;
|
|
261744
|
+
const endsWithWhiteSpace = header.length > header.trimEnd().length;
|
|
261745
|
+
if (startsWithWhiteSpace && endsWithWhiteSpace)
|
|
261746
|
+
return [false, message(["header", "must not be surrounded by whitespace"])];
|
|
261747
|
+
if (startsWithWhiteSpace)
|
|
261748
|
+
return [false, message(["header", "must not start with whitespace"])];
|
|
261749
|
+
if (endsWithWhiteSpace)
|
|
261750
|
+
return [false, message(["header", "must not end with whitespace"])];
|
|
261751
|
+
return [true];
|
|
261325
261752
|
};
|
|
261326
261753
|
|
|
261327
261754
|
// node_modules/@commitlint/rules/lib/references-empty.js
|
|
@@ -261534,7 +261961,7 @@ var subjectExclamationMark = (parsed, when = "always") => {
|
|
|
261534
261961
|
};
|
|
261535
261962
|
|
|
261536
261963
|
// node_modules/@commitlint/rules/lib/trailer-exists.js
|
|
261537
|
-
import { spawnSync } from "child_process";
|
|
261964
|
+
import { spawnSync } from "node:child_process";
|
|
261538
261965
|
var trailerExists = (parsed, when = "always", value2 = "") => {
|
|
261539
261966
|
const trailers = spawnSync("git", ["interpret-trailers", "--parse"], {
|
|
261540
261967
|
input: parsed.raw || ""
|
|
@@ -261791,11 +262218,11 @@ async function lint(message2, rawRulesConfig, rawOpts) {
|
|
|
261791
262218
|
}
|
|
261792
262219
|
|
|
261793
262220
|
// node_modules/@commitlint/load/lib/load.js
|
|
261794
|
-
import path8 from "path";
|
|
262221
|
+
import path8 from "node:path";
|
|
261795
262222
|
|
|
261796
262223
|
// node_modules/@commitlint/config-validator/lib/validate.js
|
|
261797
262224
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
261798
|
-
import { createRequire } from "module";
|
|
262225
|
+
import { createRequire } from "node:module";
|
|
261799
262226
|
|
|
261800
262227
|
// node_modules/@commitlint/config-validator/lib/formatErrors.js
|
|
261801
262228
|
function formatErrors(errors) {
|
|
@@ -261872,9 +262299,9 @@ function executable(config) {
|
|
|
261872
262299
|
}
|
|
261873
262300
|
|
|
261874
262301
|
// node_modules/@commitlint/resolve-extends/lib/index.js
|
|
261875
|
-
import fs3 from "fs";
|
|
261876
|
-
import path4 from "path";
|
|
261877
|
-
import { pathToFileURL as pathToFileURL2, fileURLToPath as fileURLToPath4 } from "url";
|
|
262302
|
+
import fs3 from "node:fs";
|
|
262303
|
+
import path4 from "node:path";
|
|
262304
|
+
import { pathToFileURL as pathToFileURL2, fileURLToPath as fileURLToPath4 } from "node:url";
|
|
261878
262305
|
|
|
261879
262306
|
// node_modules/global-directory/index.js
|
|
261880
262307
|
var import_ini = __toESM(require_ini(), 1);
|
|
@@ -263353,8 +263780,8 @@ var import_lodash9 = __toESM(require_lodash9(), 1);
|
|
|
263353
263780
|
|
|
263354
263781
|
// node_modules/@commitlint/load/lib/utils/load-config.js
|
|
263355
263782
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
263356
|
-
import { existsSync, readFileSync } from "fs";
|
|
263357
|
-
import path5 from "path";
|
|
263783
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
263784
|
+
import path5 from "node:path";
|
|
263358
263785
|
|
|
263359
263786
|
// node_modules/jiti/lib/jiti.mjs
|
|
263360
263787
|
var import_jiti = __toESM(require_jiti(), 1);
|
|
@@ -263519,9 +263946,9 @@ async function loadParserOpts(pendingParser) {
|
|
|
263519
263946
|
}
|
|
263520
263947
|
|
|
263521
263948
|
// node_modules/@commitlint/load/lib/utils/load-plugin.js
|
|
263522
|
-
import { createRequire as createRequire3 } from "module";
|
|
263523
|
-
import path7 from "path";
|
|
263524
|
-
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL3 } from "url";
|
|
263949
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
263950
|
+
import path7 from "node:path";
|
|
263951
|
+
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL3 } from "node:url";
|
|
263525
263952
|
|
|
263526
263953
|
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
263527
263954
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -264013,7 +264440,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
|
264013
264440
|
var source_default = chalk;
|
|
264014
264441
|
|
|
264015
264442
|
// node_modules/@commitlint/load/lib/utils/plugin-naming.js
|
|
264016
|
-
import path6 from "path";
|
|
264443
|
+
import path6 from "node:path";
|
|
264017
264444
|
var prefix = "commitlint-plugin";
|
|
264018
264445
|
function convertPathToPosix(filepath) {
|
|
264019
264446
|
const normalizedFilepath = path6.normalize(filepath);
|
|
@@ -264211,7 +264638,7 @@ async function getHistoryCommits(options, opts = {}) {
|
|
|
264211
264638
|
}
|
|
264212
264639
|
|
|
264213
264640
|
// node_modules/@commitlint/top-level/lib/index.js
|
|
264214
|
-
import path11 from "path";
|
|
264641
|
+
import path11 from "node:path";
|
|
264215
264642
|
|
|
264216
264643
|
// node_modules/find-up/index.js
|
|
264217
264644
|
import path10 from "node:path";
|
|
@@ -264278,6 +264705,11 @@ var Queue = class {
|
|
|
264278
264705
|
current = current.next;
|
|
264279
264706
|
}
|
|
264280
264707
|
}
|
|
264708
|
+
*drain() {
|
|
264709
|
+
while (this.#head) {
|
|
264710
|
+
yield this.dequeue();
|
|
264711
|
+
}
|
|
264712
|
+
}
|
|
264281
264713
|
};
|
|
264282
264714
|
|
|
264283
264715
|
// node_modules/p-locate/node_modules/p-limit/index.js
|
|
@@ -264460,7 +264892,7 @@ async function searchDotGit(cwd) {
|
|
|
264460
264892
|
import fs6 from "fs/promises";
|
|
264461
264893
|
|
|
264462
264894
|
// node_modules/@commitlint/read/lib/get-edit-file-path.js
|
|
264463
|
-
import path12 from "path";
|
|
264895
|
+
import path12 from "node:path";
|
|
264464
264896
|
import fs5 from "fs/promises";
|
|
264465
264897
|
async function getEditFilePath(top2, edit) {
|
|
264466
264898
|
if (typeof edit === "string") {
|
|
@@ -270303,8 +270735,6 @@ typescript/lib/typescript.js:
|
|
|
270303
270735
|
***************************************************************************** *)
|
|
270304
270736
|
|
|
270305
270737
|
cosmiconfig/dist/loaders.js:
|
|
270306
|
-
(* istanbul ignore next -- @preserve *)
|
|
270307
|
-
|
|
270308
270738
|
cosmiconfig/dist/util.js:
|
|
270309
270739
|
(* istanbul ignore next -- @preserve *)
|
|
270310
270740
|
|
|
@@ -270313,32 +270743,12 @@ cosmiconfig/dist/ExplorerBase.js:
|
|
|
270313
270743
|
(* istanbul ignore next -- @preserve *)
|
|
270314
270744
|
|
|
270315
270745
|
cosmiconfig/dist/Explorer.js:
|
|
270316
|
-
(* istanbul ignore if -- @preserve *)
|
|
270317
|
-
|
|
270318
270746
|
cosmiconfig/dist/ExplorerSync.js:
|
|
270319
270747
|
(* istanbul ignore if -- @preserve *)
|
|
270320
270748
|
|
|
270321
270749
|
yargs-parser/build/lib/string-utils.js:
|
|
270322
|
-
(**
|
|
270323
|
-
* @license
|
|
270324
|
-
* Copyright (c) 2016, Contributors
|
|
270325
|
-
* SPDX-License-Identifier: ISC
|
|
270326
|
-
*)
|
|
270327
|
-
|
|
270328
270750
|
yargs-parser/build/lib/tokenize-arg-string.js:
|
|
270329
|
-
(**
|
|
270330
|
-
* @license
|
|
270331
|
-
* Copyright (c) 2016, Contributors
|
|
270332
|
-
* SPDX-License-Identifier: ISC
|
|
270333
|
-
*)
|
|
270334
|
-
|
|
270335
270751
|
yargs-parser/build/lib/yargs-parser-types.js:
|
|
270336
|
-
(**
|
|
270337
|
-
* @license
|
|
270338
|
-
* Copyright (c) 2016, Contributors
|
|
270339
|
-
* SPDX-License-Identifier: ISC
|
|
270340
|
-
*)
|
|
270341
|
-
|
|
270342
270752
|
yargs-parser/build/lib/yargs-parser.js:
|
|
270343
270753
|
(**
|
|
270344
270754
|
* @license
|