@typescript-deploys/pr-build 5.2.0-pr-52899-20 → 5.2.0-pr-54788-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +56 -57
- package/lib/tsserver.js +65 -105
- package/lib/tsserverlibrary.d.ts +3 -3
- package/lib/tsserverlibrary.js +65 -105
- package/lib/typescript.d.ts +3 -3
- package/lib/typescript.js +65 -105
- package/lib/typingsInstaller.js +1 -4
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.2";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230626`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -6212,7 +6212,6 @@ var Diagnostics = {
|
|
|
6212
6212
|
This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: diag(2343, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343", "This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),
|
|
6213
6213
|
Type_0_does_not_satisfy_the_constraint_1: diag(2344, 1 /* Error */, "Type_0_does_not_satisfy_the_constraint_1_2344", "Type '{0}' does not satisfy the constraint '{1}'."),
|
|
6214
6214
|
Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: diag(2345, 1 /* Error */, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", "Argument of type '{0}' is not assignable to parameter of type '{1}'."),
|
|
6215
|
-
Call_target_does_not_contain_any_signatures: diag(2346, 1 /* Error */, "Call_target_does_not_contain_any_signatures_2346", "Call target does not contain any signatures."),
|
|
6216
6215
|
Untyped_function_calls_may_not_accept_type_arguments: diag(2347, 1 /* Error */, "Untyped_function_calls_may_not_accept_type_arguments_2347", "Untyped function calls may not accept type arguments."),
|
|
6217
6216
|
Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: diag(2348, 1 /* Error */, "Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348", "Value of type '{0}' is not callable. Did you mean to include 'new'?"),
|
|
6218
6217
|
This_expression_is_not_callable: diag(2349, 1 /* Error */, "This_expression_is_not_callable_2349", "This expression is not callable."),
|
|
@@ -6822,7 +6821,6 @@ var Diagnostics = {
|
|
|
6822
6821
|
Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, 1 /* Error */, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."),
|
|
6823
6822
|
_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, 1 /* Error */, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),
|
|
6824
6823
|
Cannot_read_file_0: diag(5083, 1 /* Error */, "Cannot_read_file_0_5083", "Cannot read file '{0}'."),
|
|
6825
|
-
Tuple_members_must_all_have_names_or_all_not_have_names: diag(5084, 1 /* Error */, "Tuple_members_must_all_have_names_or_all_not_have_names_5084", "Tuple members must all have names or all not have names."),
|
|
6826
6824
|
A_tuple_member_cannot_be_both_optional_and_rest: diag(5085, 1 /* Error */, "A_tuple_member_cannot_be_both_optional_and_rest_5085", "A tuple member cannot be both optional and rest."),
|
|
6827
6825
|
A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, 1 /* Error */, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),
|
|
6828
6826
|
A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, 1 /* Error */, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),
|
|
@@ -7748,7 +7746,6 @@ var Diagnostics = {
|
|
|
7748
7746
|
Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
|
|
7749
7747
|
Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
|
|
7750
7748
|
Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
|
|
7751
|
-
Add_missing_comma_for_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_object_member_completion_0_95187", "Add missing comma for object member completion '{0}'."),
|
|
7752
7749
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
7753
7750
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
7754
7751
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -46170,6 +46167,7 @@ function createTypeChecker(host) {
|
|
|
46170
46167
|
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
|
|
46171
46168
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
46172
46169
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
46170
|
+
const moduleKind2 = getEmitModuleKind(compilerOptions);
|
|
46173
46171
|
const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode);
|
|
46174
46172
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
46175
46173
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
@@ -46202,7 +46200,7 @@ function createTypeChecker(host) {
|
|
|
46202
46200
|
moduleReference
|
|
46203
46201
|
);
|
|
46204
46202
|
}
|
|
46205
|
-
if (
|
|
46203
|
+
if (100 /* Node16 */ <= moduleKind2 && moduleKind2 <= 199 /* NodeNext */) {
|
|
46206
46204
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
46207
46205
|
const overrideClauseHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
46208
46206
|
const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_h = overrideClauseHost.assertions) == null ? void 0 : _h.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause;
|
|
@@ -46326,7 +46324,7 @@ function createTypeChecker(host) {
|
|
|
46326
46324
|
return void 0;
|
|
46327
46325
|
function getSuggestedImportSource(tsExtension) {
|
|
46328
46326
|
const importSourceWithoutExtension = removeExtension(moduleReference, tsExtension);
|
|
46329
|
-
if (emitModuleKindIsNonNodeESM(
|
|
46327
|
+
if (emitModuleKindIsNonNodeESM(moduleKind2) || mode === 99 /* ESNext */) {
|
|
46330
46328
|
const preferTs = isDeclarationFileName(moduleReference) && shouldAllowImportingTsExtension(compilerOptions);
|
|
46331
46329
|
const ext = tsExtension === ".mts" /* Mts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".mts" : ".mjs" : tsExtension === ".cts" /* Cts */ || tsExtension === ".d.mts" /* Dmts */ ? preferTs ? ".cts" : ".cjs" : preferTs ? ".ts" : ".js";
|
|
46332
46330
|
return importSourceWithoutExtension + ext;
|
|
@@ -47965,19 +47963,18 @@ function createTypeChecker(host) {
|
|
|
47965
47963
|
const arity = getTypeReferenceArity(type2);
|
|
47966
47964
|
const tupleConstituentNodes = mapToTypeNodes(typeArguments.slice(0, arity), context);
|
|
47967
47965
|
if (tupleConstituentNodes) {
|
|
47968
|
-
|
|
47969
|
-
|
|
47970
|
-
|
|
47966
|
+
const { labeledElementDeclarations } = type2.target;
|
|
47967
|
+
for (let i = 0; i < tupleConstituentNodes.length; i++) {
|
|
47968
|
+
const flags = type2.target.elementFlags[i];
|
|
47969
|
+
const labeledElementDeclaration = labeledElementDeclarations == null ? void 0 : labeledElementDeclarations[i];
|
|
47970
|
+
if (labeledElementDeclaration) {
|
|
47971
47971
|
tupleConstituentNodes[i] = factory.createNamedTupleMember(
|
|
47972
47972
|
flags & 12 /* Variable */ ? factory.createToken(26 /* DotDotDotToken */) : void 0,
|
|
47973
|
-
factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(
|
|
47973
|
+
factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(labeledElementDeclaration))),
|
|
47974
47974
|
flags & 2 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
47975
47975
|
flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]
|
|
47976
47976
|
);
|
|
47977
|
-
}
|
|
47978
|
-
} else {
|
|
47979
|
-
for (let i = 0; i < Math.min(arity, tupleConstituentNodes.length); i++) {
|
|
47980
|
-
const flags = type2.target.elementFlags[i];
|
|
47977
|
+
} else {
|
|
47981
47978
|
tupleConstituentNodes[i] = flags & 12 /* Variable */ ? factory.createRestTypeNode(flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]) : flags & 2 /* Optional */ ? factory.createOptionalTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i];
|
|
47982
47979
|
}
|
|
47983
47980
|
}
|
|
@@ -53089,17 +53086,18 @@ function createTypeChecker(host) {
|
|
|
53089
53086
|
function getExpandedParameters(sig, skipUnionExpanding) {
|
|
53090
53087
|
if (signatureHasRestParameter(sig)) {
|
|
53091
53088
|
const restIndex = sig.parameters.length - 1;
|
|
53089
|
+
const restName = sig.parameters[restIndex].escapedName;
|
|
53092
53090
|
const restType = getTypeOfSymbol(sig.parameters[restIndex]);
|
|
53093
53091
|
if (isTupleType(restType)) {
|
|
53094
|
-
return [expandSignatureParametersWithTupleMembers(restType, restIndex)];
|
|
53092
|
+
return [expandSignatureParametersWithTupleMembers(restType, restIndex, restName)];
|
|
53095
53093
|
} else if (!skipUnionExpanding && restType.flags & 1048576 /* Union */ && every(restType.types, isTupleType)) {
|
|
53096
|
-
return map(restType.types, (t) => expandSignatureParametersWithTupleMembers(t, restIndex));
|
|
53094
|
+
return map(restType.types, (t) => expandSignatureParametersWithTupleMembers(t, restIndex, restName));
|
|
53097
53095
|
}
|
|
53098
53096
|
}
|
|
53099
53097
|
return [sig.parameters];
|
|
53100
|
-
function expandSignatureParametersWithTupleMembers(restType, restIndex) {
|
|
53101
|
-
const elementTypes =
|
|
53102
|
-
const associatedNames = getUniqAssociatedNamesFromTupleType(restType);
|
|
53098
|
+
function expandSignatureParametersWithTupleMembers(restType, restIndex, restName) {
|
|
53099
|
+
const elementTypes = getTypeArguments(restType);
|
|
53100
|
+
const associatedNames = getUniqAssociatedNamesFromTupleType(restType, restName);
|
|
53103
53101
|
const restParams = map(elementTypes, (t, i) => {
|
|
53104
53102
|
const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType);
|
|
53105
53103
|
const flags = restType.target.elementFlags[i];
|
|
@@ -53110,10 +53108,10 @@ function createTypeChecker(host) {
|
|
|
53110
53108
|
});
|
|
53111
53109
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
53112
53110
|
}
|
|
53113
|
-
function getUniqAssociatedNamesFromTupleType(type) {
|
|
53111
|
+
function getUniqAssociatedNamesFromTupleType(type, restName) {
|
|
53114
53112
|
const associatedNamesMap = /* @__PURE__ */ new Map();
|
|
53115
|
-
return map(type.target.labeledElementDeclarations, (labeledElement) => {
|
|
53116
|
-
const name = getTupleElementLabel(labeledElement);
|
|
53113
|
+
return map(type.target.labeledElementDeclarations, (labeledElement, i) => {
|
|
53114
|
+
const name = getTupleElementLabel(labeledElement, i, restName);
|
|
53117
53115
|
const prevCounter = associatedNamesMap.get(name);
|
|
53118
53116
|
if (prevCounter === void 0) {
|
|
53119
53117
|
associatedNamesMap.set(name, 1);
|
|
@@ -56047,13 +56045,10 @@ function createTypeChecker(host) {
|
|
|
56047
56045
|
return readonly ? globalReadonlyArrayType : globalArrayType;
|
|
56048
56046
|
}
|
|
56049
56047
|
const elementFlags = map(node.elements, getTupleElementFlags);
|
|
56050
|
-
|
|
56051
|
-
|
|
56052
|
-
|
|
56053
|
-
|
|
56054
|
-
/*associatedNames*/
|
|
56055
|
-
missingName ? void 0 : node.elements
|
|
56056
|
-
);
|
|
56048
|
+
return getTupleTargetType(elementFlags, readonly, map(node.elements, memberIfLabeledElementDeclaration));
|
|
56049
|
+
}
|
|
56050
|
+
function memberIfLabeledElementDeclaration(member) {
|
|
56051
|
+
return isNamedTupleMember(member) || isParameter(member) ? member : void 0;
|
|
56057
56052
|
}
|
|
56058
56053
|
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
|
|
56059
56054
|
return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
@@ -56128,7 +56123,7 @@ function createTypeChecker(host) {
|
|
|
56128
56123
|
function isReadonlyTypeOperator(node) {
|
|
56129
56124
|
return isTypeOperatorNode(node) && node.operator === 148 /* ReadonlyKeyword */;
|
|
56130
56125
|
}
|
|
56131
|
-
function createTupleType(elementTypes, elementFlags, readonly = false, namedMemberDeclarations) {
|
|
56126
|
+
function createTupleType(elementTypes, elementFlags, readonly = false, namedMemberDeclarations = []) {
|
|
56132
56127
|
const tupleTarget = getTupleTargetType(elementFlags || map(elementTypes, (_) => 1 /* Required */), readonly, namedMemberDeclarations);
|
|
56133
56128
|
return tupleTarget === emptyGenericType ? emptyObjectType : elementTypes.length ? createNormalizedTypeReference(tupleTarget, elementTypes) : tupleTarget;
|
|
56134
56129
|
}
|
|
@@ -56136,7 +56131,8 @@ function createTypeChecker(host) {
|
|
|
56136
56131
|
if (elementFlags.length === 1 && elementFlags[0] & 4 /* Rest */) {
|
|
56137
56132
|
return readonly ? globalReadonlyArrayType : globalArrayType;
|
|
56138
56133
|
}
|
|
56139
|
-
const
|
|
56134
|
+
const memberIds = mapDefined(namedMemberDeclarations, (node) => node ? getNodeId(node) : void 0);
|
|
56135
|
+
const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (memberIds.length ? "," + memberIds.join(",") : "");
|
|
56140
56136
|
let type = tupleTypes.get(key);
|
|
56141
56137
|
if (!type) {
|
|
56142
56138
|
tupleTypes.set(key, type = createTupleTargetType(elementFlags, readonly, namedMemberDeclarations));
|
|
@@ -56218,7 +56214,7 @@ function createTypeChecker(host) {
|
|
|
56218
56214
|
}
|
|
56219
56215
|
const expandedTypes = [];
|
|
56220
56216
|
const expandedFlags = [];
|
|
56221
|
-
|
|
56217
|
+
const expandedDeclarations = [];
|
|
56222
56218
|
let lastRequiredIndex = -1;
|
|
56223
56219
|
let firstRestIndex = -1;
|
|
56224
56220
|
let lastOptionalOrRestIndex = -1;
|
|
@@ -56256,7 +56252,7 @@ function createTypeChecker(host) {
|
|
|
56256
56252
|
));
|
|
56257
56253
|
expandedTypes.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);
|
|
56258
56254
|
expandedFlags.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);
|
|
56259
|
-
expandedDeclarations
|
|
56255
|
+
expandedDeclarations.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);
|
|
56260
56256
|
}
|
|
56261
56257
|
const tupleTarget = getTupleTargetType(expandedFlags, target.readonly, expandedDeclarations);
|
|
56262
56258
|
return tupleTarget === emptyGenericType ? emptyObjectType : expandedFlags.length ? createTypeReference(tupleTarget, expandedTypes) : tupleTarget;
|
|
@@ -56276,11 +56272,7 @@ function createTypeChecker(host) {
|
|
|
56276
56272
|
true
|
|
56277
56273
|
) : type);
|
|
56278
56274
|
expandedFlags.push(flags);
|
|
56279
|
-
|
|
56280
|
-
expandedDeclarations.push(declaration);
|
|
56281
|
-
} else {
|
|
56282
|
-
expandedDeclarations = void 0;
|
|
56283
|
-
}
|
|
56275
|
+
expandedDeclarations.push(declaration);
|
|
56284
56276
|
}
|
|
56285
56277
|
}
|
|
56286
56278
|
function sliceTupleType(type, index, endSkipCount = 0) {
|
|
@@ -60954,7 +60946,6 @@ function createTypeChecker(host) {
|
|
|
60954
60946
|
} else if (targetFlags & 8388608 /* IndexedAccess */) {
|
|
60955
60947
|
if (sourceFlags & 8388608 /* IndexedAccess */) {
|
|
60956
60948
|
if (result2 = isRelatedTo(source2.objectType, target2.objectType, 3 /* Both */, reportErrors2)) {
|
|
60957
|
-
instantiateType(source2.objectType, reportUnreliableMapper);
|
|
60958
60949
|
result2 &= isRelatedTo(source2.indexType, target2.indexType, 3 /* Both */, reportErrors2);
|
|
60959
60950
|
}
|
|
60960
60951
|
if (result2) {
|
|
@@ -70551,12 +70542,7 @@ function createTypeChecker(host) {
|
|
|
70551
70542
|
}
|
|
70552
70543
|
const candidates = candidatesOutArray || [];
|
|
70553
70544
|
reorderCandidates(signatures, candidates, callChainFlags);
|
|
70554
|
-
|
|
70555
|
-
if (reportErrors2) {
|
|
70556
|
-
diagnostics.add(getDiagnosticForCallNode(node, Diagnostics.Call_target_does_not_contain_any_signatures));
|
|
70557
|
-
}
|
|
70558
|
-
return resolveErrorCall(node);
|
|
70559
|
-
}
|
|
70545
|
+
Debug.assert(candidates.length, "Revert #54442 and add a testcase with whatever triggered this");
|
|
70560
70546
|
const args = getEffectiveCallArguments(node);
|
|
70561
70547
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
70562
70548
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
@@ -72008,7 +71994,10 @@ function createTypeChecker(host) {
|
|
|
72008
71994
|
}
|
|
72009
71995
|
return type;
|
|
72010
71996
|
}
|
|
72011
|
-
function getTupleElementLabel(d) {
|
|
71997
|
+
function getTupleElementLabel(d, index, restParameterName = "arg") {
|
|
71998
|
+
if (!d) {
|
|
71999
|
+
return `${restParameterName}_${index}`;
|
|
72000
|
+
}
|
|
72012
72001
|
Debug.assert(isIdentifier(d.name));
|
|
72013
72002
|
return d.name.escapedText;
|
|
72014
72003
|
}
|
|
@@ -72022,7 +72011,7 @@ function createTypeChecker(host) {
|
|
|
72022
72011
|
if (isTupleType(restType)) {
|
|
72023
72012
|
const associatedNames = restType.target.labeledElementDeclarations;
|
|
72024
72013
|
const index = pos - paramCount;
|
|
72025
|
-
return associatedNames
|
|
72014
|
+
return getTupleElementLabel(associatedNames == null ? void 0 : associatedNames[index], index, restParameter.escapedName);
|
|
72026
72015
|
}
|
|
72027
72016
|
return restParameter.escapedName;
|
|
72028
72017
|
}
|
|
@@ -75377,12 +75366,7 @@ function createTypeChecker(host) {
|
|
|
75377
75366
|
const elementTypes = node.elements;
|
|
75378
75367
|
let seenOptionalElement = false;
|
|
75379
75368
|
let seenRestElement = false;
|
|
75380
|
-
const hasNamedElement = some(elementTypes, isNamedTupleMember);
|
|
75381
75369
|
for (const e of elementTypes) {
|
|
75382
|
-
if (e.kind !== 202 /* NamedTupleMember */ && hasNamedElement) {
|
|
75383
|
-
grammarErrorOnNode(e, Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);
|
|
75384
|
-
break;
|
|
75385
|
-
}
|
|
75386
75370
|
const flags = getTupleElementFlags(e);
|
|
75387
75371
|
if (flags & 8 /* Variadic */) {
|
|
75388
75372
|
const type = getTypeFromTypeNode(e.type);
|
|
@@ -107537,6 +107521,21 @@ function transformDeclarations(context) {
|
|
|
107537
107521
|
const modifiers = factory2.createModifiersFromModifierFlags(getEffectiveModifierFlags(statement) & (258047 /* All */ ^ 1 /* Export */));
|
|
107538
107522
|
return factory2.updateModifiers(statement, modifiers);
|
|
107539
107523
|
}
|
|
107524
|
+
function updateModuleDeclarationAndKeyword(node, modifiers, name, body) {
|
|
107525
|
+
const updated = factory2.updateModuleDeclaration(node, modifiers, name, body);
|
|
107526
|
+
if (isAmbientModule(updated) || updated.flags & 32 /* Namespace */) {
|
|
107527
|
+
return updated;
|
|
107528
|
+
}
|
|
107529
|
+
const fixed = factory2.createModuleDeclaration(
|
|
107530
|
+
updated.modifiers,
|
|
107531
|
+
updated.name,
|
|
107532
|
+
updated.body,
|
|
107533
|
+
updated.flags | 32 /* Namespace */
|
|
107534
|
+
);
|
|
107535
|
+
setOriginalNode(fixed, updated);
|
|
107536
|
+
setTextRange(fixed, updated);
|
|
107537
|
+
return fixed;
|
|
107538
|
+
}
|
|
107540
107539
|
function transformTopLevelDeclaration(input) {
|
|
107541
107540
|
if (lateMarkedStatements) {
|
|
107542
107541
|
while (orderedRemoveItem(lateMarkedStatements, input))
|
|
@@ -107724,7 +107723,7 @@ function transformDeclarations(context) {
|
|
|
107724
107723
|
needsScopeFixMarker = oldNeedsScopeFix;
|
|
107725
107724
|
resultHasScopeMarker = oldHasScopeFix;
|
|
107726
107725
|
const mods = ensureModifiers(input);
|
|
107727
|
-
return cleanup(
|
|
107726
|
+
return cleanup(updateModuleDeclarationAndKeyword(
|
|
107728
107727
|
input,
|
|
107729
107728
|
mods,
|
|
107730
107729
|
isExternalModuleAugmentation(input) ? rewriteModuleSpecifier(input, input.name) : input.name,
|
|
@@ -107738,7 +107737,7 @@ function transformDeclarations(context) {
|
|
|
107738
107737
|
const id = getOriginalNodeId(inner);
|
|
107739
107738
|
const body = lateStatementReplacementMap.get(id);
|
|
107740
107739
|
lateStatementReplacementMap.delete(id);
|
|
107741
|
-
return cleanup(
|
|
107740
|
+
return cleanup(updateModuleDeclarationAndKeyword(
|
|
107742
107741
|
input,
|
|
107743
107742
|
mods,
|
|
107744
107743
|
input.name,
|
|
@@ -115086,9 +115085,9 @@ function getConfigFileParsingDiagnostics(configFileParseResult) {
|
|
|
115086
115085
|
return configFileParseResult.options.configFile ? [...configFileParseResult.options.configFile.parseDiagnostics, ...configFileParseResult.errors] : configFileParseResult.errors;
|
|
115087
115086
|
}
|
|
115088
115087
|
function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) {
|
|
115089
|
-
switch (
|
|
115090
|
-
case
|
|
115091
|
-
case
|
|
115088
|
+
switch (getEmitModuleKind(options)) {
|
|
115089
|
+
case 100 /* Node16 */:
|
|
115090
|
+
case 199 /* NodeNext */:
|
|
115092
115091
|
return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
|
|
115093
115092
|
default:
|
|
115094
115093
|
return void 0;
|