typescript 4.9.0-dev.20221013 → 4.9.0-dev.20221014
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 +109 -117
- package/lib/tsserver.js +281 -157
- package/lib/tsserverlibrary.js +281 -157
- package/lib/typescript.js +281 -157
- package/lib/typescriptServices.js +281 -157
- package/lib/typingsInstaller.js +130 -144
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.9";
|
|
72
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
72
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221014");
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -7065,6 +7065,8 @@ var ts;
|
|
|
7065
7065
|
Remove_type_from_import_of_0_from_1: diag(90056, ts.DiagnosticCategory.Message, "Remove_type_from_import_of_0_from_1_90056", "Remove 'type' from import of '{0}' from \"{1}\""),
|
|
7066
7066
|
Add_import_from_0: diag(90057, ts.DiagnosticCategory.Message, "Add_import_from_0_90057", "Add import from \"{0}\""),
|
|
7067
7067
|
Update_import_from_0: diag(90058, ts.DiagnosticCategory.Message, "Update_import_from_0_90058", "Update import from \"{0}\""),
|
|
7068
|
+
Export_0_from_module_1: diag(90059, ts.DiagnosticCategory.Message, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
|
|
7069
|
+
Export_all_referenced_locals: diag(90060, ts.DiagnosticCategory.Message, "Export_all_referenced_locals_90060", "Export all referenced locals"),
|
|
7068
7070
|
Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
7069
7071
|
Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
7070
7072
|
Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -17284,6 +17286,32 @@ var ts;
|
|
|
17284
17286
|
return parameter.kind === 343 ? (_a = parameter.typeExpression) === null || _a === void 0 ? void 0 : _a.type : parameter.type;
|
|
17285
17287
|
}
|
|
17286
17288
|
ts.getParameterTypeNode = getParameterTypeNode;
|
|
17289
|
+
function isTypeDeclaration(node) {
|
|
17290
|
+
switch (node.kind) {
|
|
17291
|
+
case 165:
|
|
17292
|
+
case 260:
|
|
17293
|
+
case 261:
|
|
17294
|
+
case 262:
|
|
17295
|
+
case 263:
|
|
17296
|
+
case 348:
|
|
17297
|
+
case 341:
|
|
17298
|
+
case 342:
|
|
17299
|
+
return true;
|
|
17300
|
+
case 270:
|
|
17301
|
+
return node.isTypeOnly;
|
|
17302
|
+
case 273:
|
|
17303
|
+
case 278:
|
|
17304
|
+
return node.parent.parent.isTypeOnly;
|
|
17305
|
+
default:
|
|
17306
|
+
return false;
|
|
17307
|
+
}
|
|
17308
|
+
}
|
|
17309
|
+
ts.isTypeDeclaration = isTypeDeclaration;
|
|
17310
|
+
function canHaveExportModifier(node) {
|
|
17311
|
+
return ts.isEnumDeclaration(node) || ts.isVariableStatement(node) || ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node)
|
|
17312
|
+
|| ts.isInterfaceDeclaration(node) || isTypeDeclaration(node) || (ts.isModuleDeclaration(node) && !isExternalModuleAugmentation(node) && !isGlobalScopeAugmentation(node));
|
|
17313
|
+
}
|
|
17314
|
+
ts.canHaveExportModifier = canHaveExportModifier;
|
|
17287
17315
|
})(ts || (ts = {}));
|
|
17288
17316
|
var ts;
|
|
17289
17317
|
(function (ts) {
|
|
@@ -45842,7 +45870,7 @@ var ts;
|
|
|
45842
45870
|
if (!e.propertyName) {
|
|
45843
45871
|
var indices = ts.indicesOf(statements);
|
|
45844
45872
|
var associatedIndices = ts.filter(indices, function (i) { return ts.nodeHasName(statements[i], e.name); });
|
|
45845
|
-
if (ts.length(associatedIndices) && ts.every(associatedIndices, function (i) { return canHaveExportModifier(statements[i]); })) {
|
|
45873
|
+
if (ts.length(associatedIndices) && ts.every(associatedIndices, function (i) { return ts.canHaveExportModifier(statements[i]); })) {
|
|
45846
45874
|
for (var _i = 0, associatedIndices_1 = associatedIndices; _i < associatedIndices_1.length; _i++) {
|
|
45847
45875
|
var index_1 = associatedIndices_1[_i];
|
|
45848
45876
|
statements[index_1] = addExportModifier(statements[index_1]);
|
|
@@ -45872,15 +45900,6 @@ var ts;
|
|
|
45872
45900
|
}
|
|
45873
45901
|
return statements;
|
|
45874
45902
|
}
|
|
45875
|
-
function canHaveExportModifier(node) {
|
|
45876
|
-
return ts.isEnumDeclaration(node) ||
|
|
45877
|
-
ts.isVariableStatement(node) ||
|
|
45878
|
-
ts.isFunctionDeclaration(node) ||
|
|
45879
|
-
ts.isClassDeclaration(node) ||
|
|
45880
|
-
(ts.isModuleDeclaration(node) && !ts.isExternalModuleAugmentation(node) && !ts.isGlobalScopeAugmentation(node)) ||
|
|
45881
|
-
ts.isInterfaceDeclaration(node) ||
|
|
45882
|
-
isTypeDeclaration(node);
|
|
45883
|
-
}
|
|
45884
45903
|
function addExportModifier(node) {
|
|
45885
45904
|
var flags = (ts.getEffectiveModifierFlags(node) | 1) & ~2;
|
|
45886
45905
|
return ts.factory.updateModifiers(node, flags);
|
|
@@ -46065,7 +46084,7 @@ var ts;
|
|
|
46065
46084
|
(ts.isJSDocTypeAlias(context.enclosingDeclaration) ? ts.getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
|
|
46066
46085
|
if (additionalModifierFlags & 1 &&
|
|
46067
46086
|
enclosingDeclaration_1 && (isExportingScope(enclosingDeclaration_1) || ts.isModuleDeclaration(enclosingDeclaration_1)) &&
|
|
46068
|
-
canHaveExportModifier(node)) {
|
|
46087
|
+
ts.canHaveExportModifier(node)) {
|
|
46069
46088
|
newModifierFlags |= 1;
|
|
46070
46089
|
}
|
|
46071
46090
|
if (addingDeclare && !(newModifierFlags & 1) &&
|
|
@@ -53135,18 +53154,18 @@ var ts;
|
|
|
53135
53154
|
var result;
|
|
53136
53155
|
var extraTypes;
|
|
53137
53156
|
var tailCount = 0;
|
|
53138
|
-
|
|
53157
|
+
while (true) {
|
|
53139
53158
|
if (tailCount === 1000) {
|
|
53140
53159
|
error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
53141
53160
|
result = errorType;
|
|
53142
|
-
|
|
53161
|
+
break;
|
|
53143
53162
|
}
|
|
53144
53163
|
var isUnwrapped = isTypicalNondistributiveConditional(root);
|
|
53145
53164
|
var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
|
|
53146
53165
|
var checkTypeInstantiable = isGenericType(checkType);
|
|
53147
53166
|
var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
|
|
53148
53167
|
if (checkType === wildcardType || extendsType === wildcardType) {
|
|
53149
|
-
return
|
|
53168
|
+
return wildcardType;
|
|
53150
53169
|
}
|
|
53151
53170
|
var combinedMapper = void 0;
|
|
53152
53171
|
if (root.inferTypeParameters) {
|
|
@@ -53162,7 +53181,7 @@ var ts;
|
|
|
53162
53181
|
}
|
|
53163
53182
|
}
|
|
53164
53183
|
}
|
|
53165
|
-
if (!checkTypeInstantiable
|
|
53184
|
+
if (!checkTypeInstantiable) {
|
|
53166
53185
|
inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 | 1024);
|
|
53167
53186
|
}
|
|
53168
53187
|
var innerMapper = combineTypeMappers(freshMapper, context.mapper);
|
|
@@ -53179,23 +53198,23 @@ var ts;
|
|
|
53179
53198
|
var newRoot = falseType_1.root;
|
|
53180
53199
|
if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) {
|
|
53181
53200
|
root = newRoot;
|
|
53182
|
-
|
|
53201
|
+
continue;
|
|
53183
53202
|
}
|
|
53184
53203
|
if (canTailRecurse(falseType_1, mapper)) {
|
|
53185
|
-
|
|
53204
|
+
continue;
|
|
53186
53205
|
}
|
|
53187
53206
|
}
|
|
53188
53207
|
result = instantiateType(falseType_1, mapper);
|
|
53189
|
-
|
|
53208
|
+
break;
|
|
53190
53209
|
}
|
|
53191
53210
|
if (inferredExtendsType.flags & 3 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {
|
|
53192
53211
|
var trueType_1 = getTypeFromTypeNode(root.node.trueType);
|
|
53193
53212
|
var trueMapper = combinedMapper || mapper;
|
|
53194
53213
|
if (canTailRecurse(trueType_1, trueMapper)) {
|
|
53195
|
-
|
|
53214
|
+
continue;
|
|
53196
53215
|
}
|
|
53197
53216
|
result = instantiateType(trueType_1, trueMapper);
|
|
53198
|
-
|
|
53217
|
+
break;
|
|
53199
53218
|
}
|
|
53200
53219
|
}
|
|
53201
53220
|
result = createType(16777216);
|
|
@@ -53206,14 +53225,7 @@ var ts;
|
|
|
53206
53225
|
result.combinedMapper = combinedMapper;
|
|
53207
53226
|
result.aliasSymbol = aliasSymbol || root.aliasSymbol;
|
|
53208
53227
|
result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root.aliasTypeArguments, mapper);
|
|
53209
|
-
|
|
53210
|
-
};
|
|
53211
|
-
while (true) {
|
|
53212
|
-
var state_6 = _loop_20();
|
|
53213
|
-
if (typeof state_6 === "object")
|
|
53214
|
-
return state_6.value;
|
|
53215
|
-
if (state_6 === "break")
|
|
53216
|
-
break;
|
|
53228
|
+
break;
|
|
53217
53229
|
}
|
|
53218
53230
|
return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
|
|
53219
53231
|
function canTailRecurse(newType, newMapper) {
|
|
@@ -55429,7 +55441,7 @@ var ts;
|
|
|
55429
55441
|
return 0;
|
|
55430
55442
|
}
|
|
55431
55443
|
}
|
|
55432
|
-
var isPerformingCommonPropertyChecks = (relation !== comparableRelation ||
|
|
55444
|
+
var isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source)) &&
|
|
55433
55445
|
!(intersectionState & 2) &&
|
|
55434
55446
|
source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
|
|
55435
55447
|
target.flags & (524288 | 2097152) && isWeakType(target) &&
|
|
@@ -55457,12 +55469,6 @@ var ts;
|
|
|
55457
55469
|
var result_7 = skipCaching ?
|
|
55458
55470
|
unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
|
|
55459
55471
|
recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
|
|
55460
|
-
if (result_7 && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
|
|
55461
|
-
isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 262144); }))) {
|
|
55462
|
-
inPropertyCheck = true;
|
|
55463
|
-
result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
|
|
55464
|
-
inPropertyCheck = false;
|
|
55465
|
-
}
|
|
55466
55472
|
if (result_7) {
|
|
55467
55473
|
return result_7;
|
|
55468
55474
|
}
|
|
@@ -55571,7 +55577,7 @@ var ts;
|
|
|
55571
55577
|
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
|
55572
55578
|
checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
|
|
55573
55579
|
}
|
|
55574
|
-
var
|
|
55580
|
+
var _loop_20 = function (prop) {
|
|
55575
55581
|
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
|
55576
55582
|
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
|
55577
55583
|
if (reportErrors) {
|
|
@@ -55624,9 +55630,9 @@ var ts;
|
|
|
55624
55630
|
};
|
|
55625
55631
|
for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
|
|
55626
55632
|
var prop = _b[_i];
|
|
55627
|
-
var
|
|
55628
|
-
if (typeof
|
|
55629
|
-
return
|
|
55633
|
+
var state_6 = _loop_20(prop);
|
|
55634
|
+
if (typeof state_6 === "object")
|
|
55635
|
+
return state_6.value;
|
|
55630
55636
|
}
|
|
55631
55637
|
return false;
|
|
55632
55638
|
}
|
|
@@ -55806,8 +55812,7 @@ var ts;
|
|
|
55806
55812
|
if (overflow) {
|
|
55807
55813
|
return 0;
|
|
55808
55814
|
}
|
|
55809
|
-
var
|
|
55810
|
-
var id = getRelationKey(source, target, keyIntersectionState, relation, false);
|
|
55815
|
+
var id = getRelationKey(source, target, intersectionState, relation, false);
|
|
55811
55816
|
var entry = relation.get(id);
|
|
55812
55817
|
if (entry !== undefined) {
|
|
55813
55818
|
if (reportErrors && entry & 2 && !(entry & 4)) {
|
|
@@ -55831,7 +55836,7 @@ var ts;
|
|
|
55831
55836
|
targetStack = [];
|
|
55832
55837
|
}
|
|
55833
55838
|
else {
|
|
55834
|
-
var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target,
|
|
55839
|
+
var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, intersectionState, relation, true) : undefined;
|
|
55835
55840
|
for (var i = 0; i < maybeCount; i++) {
|
|
55836
55841
|
if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
|
|
55837
55842
|
return 3;
|
|
@@ -55913,10 +55918,18 @@ var ts;
|
|
|
55913
55918
|
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
|
|
55914
55919
|
var saveErrorInfo = captureErrorCalculationState();
|
|
55915
55920
|
var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState, saveErrorInfo);
|
|
55916
|
-
if (
|
|
55917
|
-
|
|
55918
|
-
|
|
55919
|
-
|
|
55921
|
+
if (relation !== identityRelation) {
|
|
55922
|
+
if (!result && (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576)) {
|
|
55923
|
+
var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
|
|
55924
|
+
if (constraint && !(constraint.flags & 131072) && everyType(constraint, function (c) { return c !== source; })) {
|
|
55925
|
+
result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState);
|
|
55926
|
+
}
|
|
55927
|
+
}
|
|
55928
|
+
if (result && !inPropertyCheck && (target.flags & 2097152 && !isGenericObjectType(target) && source.flags & (524288 | 2097152) ||
|
|
55929
|
+
isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 262144); }))) {
|
|
55930
|
+
inPropertyCheck = true;
|
|
55931
|
+
result &= propertiesRelatedTo(source, target, reportErrors, undefined, 0);
|
|
55932
|
+
inPropertyCheck = false;
|
|
55920
55933
|
}
|
|
55921
55934
|
}
|
|
55922
55935
|
if (result) {
|
|
@@ -55925,9 +55938,6 @@ var ts;
|
|
|
55925
55938
|
return result;
|
|
55926
55939
|
}
|
|
55927
55940
|
function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState, saveErrorInfo) {
|
|
55928
|
-
if (intersectionState & 4) {
|
|
55929
|
-
return propertiesRelatedTo(source, target, reportErrors, undefined, 0);
|
|
55930
|
-
}
|
|
55931
55941
|
var result;
|
|
55932
55942
|
var originalErrorInfo;
|
|
55933
55943
|
var varianceCheckFailed = false;
|
|
@@ -56403,11 +56413,11 @@ var ts;
|
|
|
56403
56413
|
}
|
|
56404
56414
|
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
|
56405
56415
|
var matchingTypes = [];
|
|
56406
|
-
var
|
|
56416
|
+
var _loop_21 = function (combination) {
|
|
56407
56417
|
var hasMatch = false;
|
|
56408
56418
|
outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
|
|
56409
56419
|
var type = _d[_c];
|
|
56410
|
-
var
|
|
56420
|
+
var _loop_22 = function (i) {
|
|
56411
56421
|
var sourceProperty = sourcePropertiesFiltered[i];
|
|
56412
56422
|
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
|
56413
56423
|
if (!targetProperty)
|
|
@@ -56420,8 +56430,8 @@ var ts;
|
|
|
56420
56430
|
}
|
|
56421
56431
|
};
|
|
56422
56432
|
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
|
56423
|
-
var
|
|
56424
|
-
switch (
|
|
56433
|
+
var state_8 = _loop_22(i);
|
|
56434
|
+
switch (state_8) {
|
|
56425
56435
|
case "continue-outer": continue outer;
|
|
56426
56436
|
}
|
|
56427
56437
|
}
|
|
@@ -56434,9 +56444,9 @@ var ts;
|
|
|
56434
56444
|
};
|
|
56435
56445
|
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
|
56436
56446
|
var combination = discriminantCombinations_1[_a];
|
|
56437
|
-
var
|
|
56438
|
-
if (typeof
|
|
56439
|
-
return
|
|
56447
|
+
var state_7 = _loop_21(combination);
|
|
56448
|
+
if (typeof state_7 === "object")
|
|
56449
|
+
return state_7.value;
|
|
56440
56450
|
}
|
|
56441
56451
|
var result = -1;
|
|
56442
56452
|
for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) {
|
|
@@ -57078,7 +57088,7 @@ var ts;
|
|
|
57078
57088
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
57079
57089
|
links.variances = ts.emptyArray;
|
|
57080
57090
|
var variances = [];
|
|
57081
|
-
var
|
|
57091
|
+
var _loop_23 = function (tp) {
|
|
57082
57092
|
var modifiers = getVarianceModifiers(tp);
|
|
57083
57093
|
var variance = modifiers & 65536 ?
|
|
57084
57094
|
modifiers & 32768 ? 0 : 1 :
|
|
@@ -57109,7 +57119,7 @@ var ts;
|
|
|
57109
57119
|
};
|
|
57110
57120
|
for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
|
|
57111
57121
|
var tp = typeParameters_2[_i];
|
|
57112
|
-
|
|
57122
|
+
_loop_23(tp);
|
|
57113
57123
|
}
|
|
57114
57124
|
links.variances = variances;
|
|
57115
57125
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
|
|
@@ -58754,7 +58764,7 @@ var ts;
|
|
|
58754
58764
|
var matches = inferTypesFromTemplateLiteralType(source, target);
|
|
58755
58765
|
var types = target.types;
|
|
58756
58766
|
if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
|
|
58757
|
-
var
|
|
58767
|
+
var _loop_24 = function (i) {
|
|
58758
58768
|
var source_1 = matches ? matches[i] : neverType;
|
|
58759
58769
|
var target_3 = types[i];
|
|
58760
58770
|
if (source_1.flags & 128 && target_3.flags & 8650752) {
|
|
@@ -58798,7 +58808,7 @@ var ts;
|
|
|
58798
58808
|
inferFromTypes(source_1, target_3);
|
|
58799
58809
|
};
|
|
58800
58810
|
for (var i = 0; i < types.length; i++) {
|
|
58801
|
-
|
|
58811
|
+
_loop_24(i);
|
|
58802
58812
|
}
|
|
58803
58813
|
}
|
|
58804
58814
|
}
|
|
@@ -59278,7 +59288,7 @@ var ts;
|
|
|
59278
59288
|
function mapTypesByKeyProperty(types, name) {
|
|
59279
59289
|
var map = new ts.Map();
|
|
59280
59290
|
var count = 0;
|
|
59281
|
-
var
|
|
59291
|
+
var _loop_25 = function (type) {
|
|
59282
59292
|
if (type.flags & (524288 | 2097152 | 58982400)) {
|
|
59283
59293
|
var discriminant = getTypeOfPropertyOfType(type, name);
|
|
59284
59294
|
if (discriminant) {
|
|
@@ -59304,9 +59314,9 @@ var ts;
|
|
|
59304
59314
|
};
|
|
59305
59315
|
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
59306
59316
|
var type = types_15[_i];
|
|
59307
|
-
var
|
|
59308
|
-
if (typeof
|
|
59309
|
-
return
|
|
59317
|
+
var state_9 = _loop_25(type);
|
|
59318
|
+
if (typeof state_9 === "object")
|
|
59319
|
+
return state_9.value;
|
|
59310
59320
|
}
|
|
59311
59321
|
return count >= 10 && count * 2 >= types.length ? map : undefined;
|
|
59312
59322
|
}
|
|
@@ -64808,7 +64818,7 @@ var ts;
|
|
|
64808
64818
|
var spreadIndex = getSpreadArgumentIndex(args);
|
|
64809
64819
|
if (spreadIndex >= 0) {
|
|
64810
64820
|
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
|
64811
|
-
var
|
|
64821
|
+
var _loop_26 = function (i) {
|
|
64812
64822
|
var arg = args[i];
|
|
64813
64823
|
var spreadType = arg.kind === 227 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
64814
64824
|
if (spreadType && isTupleType(spreadType)) {
|
|
@@ -64824,7 +64834,7 @@ var ts;
|
|
|
64824
64834
|
}
|
|
64825
64835
|
};
|
|
64826
64836
|
for (var i = spreadIndex; i < args.length; i++) {
|
|
64827
|
-
|
|
64837
|
+
_loop_26(i);
|
|
64828
64838
|
}
|
|
64829
64839
|
return effectiveArgs_1;
|
|
64830
64840
|
}
|
|
@@ -65074,7 +65084,7 @@ var ts;
|
|
|
65074
65084
|
var min_3 = Number.MAX_VALUE;
|
|
65075
65085
|
var minIndex = 0;
|
|
65076
65086
|
var i_1 = 0;
|
|
65077
|
-
var
|
|
65087
|
+
var _loop_27 = function (c) {
|
|
65078
65088
|
var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
|
|
65079
65089
|
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
|
|
65080
65090
|
if (diags_2) {
|
|
@@ -65092,7 +65102,7 @@ var ts;
|
|
|
65092
65102
|
};
|
|
65093
65103
|
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
|
65094
65104
|
var c = candidatesForArgumentError_1[_a];
|
|
65095
|
-
|
|
65105
|
+
_loop_27(c);
|
|
65096
65106
|
}
|
|
65097
65107
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
65098
65108
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
@@ -65235,7 +65245,7 @@ var ts;
|
|
|
65235
65245
|
}
|
|
65236
65246
|
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
|
65237
65247
|
var parameters = [];
|
|
65238
|
-
var
|
|
65248
|
+
var _loop_28 = function (i) {
|
|
65239
65249
|
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
|
65240
65250
|
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
|
65241
65251
|
i < s.parameters.length ? s.parameters[i] : undefined; });
|
|
@@ -65243,7 +65253,7 @@ var ts;
|
|
|
65243
65253
|
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
|
65244
65254
|
};
|
|
65245
65255
|
for (var i = 0; i < maxNonRestParam; i++) {
|
|
65246
|
-
|
|
65256
|
+
_loop_28(i);
|
|
65247
65257
|
}
|
|
65248
65258
|
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
|
65249
65259
|
var flags = 0;
|
|
@@ -68873,7 +68883,7 @@ var ts;
|
|
|
68873
68883
|
var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
|
|
68874
68884
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
68875
68885
|
var indexSignatureMap_1 = new ts.Map();
|
|
68876
|
-
var
|
|
68886
|
+
var _loop_29 = function (declaration) {
|
|
68877
68887
|
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
|
68878
68888
|
forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
|
|
68879
68889
|
var entry = indexSignatureMap_1.get(getTypeId(type));
|
|
@@ -68888,7 +68898,7 @@ var ts;
|
|
|
68888
68898
|
};
|
|
68889
68899
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
68890
68900
|
var declaration = _a[_i];
|
|
68891
|
-
|
|
68901
|
+
_loop_29(declaration);
|
|
68892
68902
|
}
|
|
68893
68903
|
indexSignatureMap_1.forEach(function (entry) {
|
|
68894
68904
|
if (entry.declarations.length > 1) {
|
|
@@ -69134,7 +69144,7 @@ var ts;
|
|
|
69134
69144
|
}
|
|
69135
69145
|
var symbol = getNodeLinks(node).resolvedSymbol;
|
|
69136
69146
|
if (symbol) {
|
|
69137
|
-
if (ts.some(symbol.declarations, function (d) { return isTypeDeclaration(d) && !!(d.flags & 268435456); })) {
|
|
69147
|
+
if (ts.some(symbol.declarations, function (d) { return ts.isTypeDeclaration(d) && !!(d.flags & 268435456); })) {
|
|
69138
69148
|
addDeprecatedSuggestion(getDeprecatedSuggestionNode(node), symbol.declarations, symbol.escapedName);
|
|
69139
69149
|
}
|
|
69140
69150
|
if (type.flags & 32 && symbol.flags & 8) {
|
|
@@ -70255,7 +70265,7 @@ var ts;
|
|
|
70255
70265
|
}
|
|
70256
70266
|
function errorUnusedLocal(declaration, name, addDiagnostic) {
|
|
70257
70267
|
var node = ts.getNameOfDeclaration(declaration) || declaration;
|
|
70258
|
-
var message = isTypeDeclaration(declaration) ? ts.Diagnostics._0_is_declared_but_never_used : ts.Diagnostics._0_is_declared_but_its_value_is_never_read;
|
|
70268
|
+
var message = ts.isTypeDeclaration(declaration) ? ts.Diagnostics._0_is_declared_but_never_used : ts.Diagnostics._0_is_declared_but_its_value_is_never_read;
|
|
70259
70269
|
addDiagnostic(declaration, 0, ts.createDiagnosticForNode(node, message, name));
|
|
70260
70270
|
}
|
|
70261
70271
|
function isIdentifierThatStartsWithUnderscore(node) {
|
|
@@ -71834,7 +71844,7 @@ var ts;
|
|
|
71834
71844
|
var propDeclaration = declaration && declaration.kind === 223 ||
|
|
71835
71845
|
name && name.kind === 164 ? declaration : undefined;
|
|
71836
71846
|
var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
|
|
71837
|
-
var
|
|
71847
|
+
var _loop_30 = function (info) {
|
|
71838
71848
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
71839
71849
|
var errorNode = localPropDeclaration || localIndexDeclaration ||
|
|
71840
71850
|
(interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
|
|
@@ -71848,7 +71858,7 @@ var ts;
|
|
|
71848
71858
|
};
|
|
71849
71859
|
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
71850
71860
|
var info = indexInfos_9[_i];
|
|
71851
|
-
|
|
71861
|
+
_loop_30(info);
|
|
71852
71862
|
}
|
|
71853
71863
|
}
|
|
71854
71864
|
function checkIndexConstraintForIndexSignature(type, checkInfo) {
|
|
@@ -71856,7 +71866,7 @@ var ts;
|
|
|
71856
71866
|
var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
|
|
71857
71867
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 261) : undefined;
|
|
71858
71868
|
var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
|
|
71859
|
-
var
|
|
71869
|
+
var _loop_31 = function (info) {
|
|
71860
71870
|
if (info === checkInfo)
|
|
71861
71871
|
return "continue";
|
|
71862
71872
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
@@ -71868,7 +71878,7 @@ var ts;
|
|
|
71868
71878
|
};
|
|
71869
71879
|
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
71870
71880
|
var info = indexInfos_10[_i];
|
|
71871
|
-
|
|
71881
|
+
_loop_31(info);
|
|
71872
71882
|
}
|
|
71873
71883
|
}
|
|
71874
71884
|
function checkTypeNameIsReserved(name, message) {
|
|
@@ -71918,7 +71928,7 @@ var ts;
|
|
|
71918
71928
|
}
|
|
71919
71929
|
else {
|
|
71920
71930
|
ts.forEach(jsdocParameters, function (_a, index) {
|
|
71921
|
-
var name = _a.name;
|
|
71931
|
+
var name = _a.name, isNameFirst = _a.isNameFirst;
|
|
71922
71932
|
if (excludedParameters.has(index) || ts.isIdentifier(name) && parameters.has(name.escapedText)) {
|
|
71923
71933
|
return;
|
|
71924
71934
|
}
|
|
@@ -71928,7 +71938,9 @@ var ts;
|
|
|
71928
71938
|
}
|
|
71929
71939
|
}
|
|
71930
71940
|
else {
|
|
71931
|
-
|
|
71941
|
+
if (!isNameFirst) {
|
|
71942
|
+
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
|
|
71943
|
+
}
|
|
71932
71944
|
}
|
|
71933
71945
|
});
|
|
71934
71946
|
}
|
|
@@ -72163,7 +72175,7 @@ var ts;
|
|
|
72163
72175
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
72164
72176
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
72165
72177
|
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
72166
|
-
var
|
|
72178
|
+
var _loop_32 = function (member) {
|
|
72167
72179
|
if (ts.hasAmbientModifier(member)) {
|
|
72168
72180
|
return "continue";
|
|
72169
72181
|
}
|
|
@@ -72178,7 +72190,7 @@ var ts;
|
|
|
72178
72190
|
};
|
|
72179
72191
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
72180
72192
|
var member = _a[_i];
|
|
72181
|
-
|
|
72193
|
+
_loop_32(member);
|
|
72182
72194
|
}
|
|
72183
72195
|
}
|
|
72184
72196
|
function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
|
|
@@ -72253,7 +72265,7 @@ var ts;
|
|
|
72253
72265
|
}
|
|
72254
72266
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
72255
72267
|
var issuedMemberError = false;
|
|
72256
|
-
var
|
|
72268
|
+
var _loop_33 = function (member) {
|
|
72257
72269
|
if (ts.isStatic(member)) {
|
|
72258
72270
|
return "continue";
|
|
72259
72271
|
}
|
|
@@ -72271,7 +72283,7 @@ var ts;
|
|
|
72271
72283
|
};
|
|
72272
72284
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
72273
72285
|
var member = _a[_i];
|
|
72274
|
-
|
|
72286
|
+
_loop_33(member);
|
|
72275
72287
|
}
|
|
72276
72288
|
if (!issuedMemberError) {
|
|
72277
72289
|
checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
|
|
@@ -72318,7 +72330,7 @@ var ts;
|
|
|
72318
72330
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
72319
72331
|
var _a, _b, _c, _d;
|
|
72320
72332
|
var baseProperties = getPropertiesOfType(baseType);
|
|
72321
|
-
var
|
|
72333
|
+
var _loop_34 = function (baseProperty) {
|
|
72322
72334
|
var base = getTargetSymbol(baseProperty);
|
|
72323
72335
|
if (base.flags & 4194304) {
|
|
72324
72336
|
return "continue";
|
|
@@ -72416,8 +72428,8 @@ var ts;
|
|
|
72416
72428
|
};
|
|
72417
72429
|
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
72418
72430
|
var baseProperty = baseProperties_1[_i];
|
|
72419
|
-
var
|
|
72420
|
-
switch (
|
|
72431
|
+
var state_10 = _loop_34(baseProperty);
|
|
72432
|
+
switch (state_10) {
|
|
72421
72433
|
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
72422
72434
|
}
|
|
72423
72435
|
}
|
|
@@ -73975,29 +73987,9 @@ var ts;
|
|
|
73975
73987
|
}
|
|
73976
73988
|
function isTypeDeclarationName(name) {
|
|
73977
73989
|
return name.kind === 79 &&
|
|
73978
|
-
isTypeDeclaration(name.parent) &&
|
|
73990
|
+
ts.isTypeDeclaration(name.parent) &&
|
|
73979
73991
|
ts.getNameOfDeclaration(name.parent) === name;
|
|
73980
73992
|
}
|
|
73981
|
-
function isTypeDeclaration(node) {
|
|
73982
|
-
switch (node.kind) {
|
|
73983
|
-
case 165:
|
|
73984
|
-
case 260:
|
|
73985
|
-
case 261:
|
|
73986
|
-
case 262:
|
|
73987
|
-
case 263:
|
|
73988
|
-
case 348:
|
|
73989
|
-
case 341:
|
|
73990
|
-
case 342:
|
|
73991
|
-
return true;
|
|
73992
|
-
case 270:
|
|
73993
|
-
return node.isTypeOnly;
|
|
73994
|
-
case 273:
|
|
73995
|
-
case 278:
|
|
73996
|
-
return node.parent.parent.isTypeOnly;
|
|
73997
|
-
default:
|
|
73998
|
-
return false;
|
|
73999
|
-
}
|
|
74000
|
-
}
|
|
74001
73993
|
function isTypeReferenceIdentifier(node) {
|
|
74002
73994
|
while (node.parent.kind === 163) {
|
|
74003
73995
|
node = node.parent;
|
|
@@ -74392,7 +74384,7 @@ var ts;
|
|
|
74392
74384
|
var baseType = ts.firstOrUndefined(getBaseTypes(classType));
|
|
74393
74385
|
return baseType ? getTypeWithThisArgument(baseType, classType.thisType) : errorType;
|
|
74394
74386
|
}
|
|
74395
|
-
if (isTypeDeclaration(node)) {
|
|
74387
|
+
if (ts.isTypeDeclaration(node)) {
|
|
74396
74388
|
var symbol = getSymbolOfNode(node);
|
|
74397
74389
|
return getDeclaredTypeOfSymbol(symbol);
|
|
74398
74390
|
}
|
|
@@ -103786,7 +103778,7 @@ var ts;
|
|
|
103786
103778
|
importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
|
|
103787
103779
|
});
|
|
103788
103780
|
var sortedPaths = [];
|
|
103789
|
-
var
|
|
103781
|
+
var _loop_35 = function (directory) {
|
|
103790
103782
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
103791
103783
|
var pathsInDirectory;
|
|
103792
103784
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -103810,9 +103802,9 @@ var ts;
|
|
|
103810
103802
|
};
|
|
103811
103803
|
var out_directory_1;
|
|
103812
103804
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
103813
|
-
var
|
|
103805
|
+
var state_11 = _loop_35(directory);
|
|
103814
103806
|
directory = out_directory_1;
|
|
103815
|
-
if (
|
|
103807
|
+
if (state_11 === "break")
|
|
103816
103808
|
break;
|
|
103817
103809
|
}
|
|
103818
103810
|
if (allFileNames.size) {
|
|
@@ -103871,7 +103863,7 @@ var ts;
|
|
|
103871
103863
|
}
|
|
103872
103864
|
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
|
|
103873
103865
|
for (var key in paths) {
|
|
103874
|
-
var
|
|
103866
|
+
var _loop_36 = function (patternText_1) {
|
|
103875
103867
|
var pattern = ts.normalizePath(patternText_1);
|
|
103876
103868
|
var indexOfStar = pattern.indexOf("*");
|
|
103877
103869
|
var candidates = allowedEndings.map(function (ending) { return ({
|
|
@@ -103902,9 +103894,9 @@ var ts;
|
|
|
103902
103894
|
};
|
|
103903
103895
|
for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
|
|
103904
103896
|
var patternText_1 = _a[_i];
|
|
103905
|
-
var
|
|
103906
|
-
if (typeof
|
|
103907
|
-
return
|
|
103897
|
+
var state_12 = _loop_36(patternText_1);
|
|
103898
|
+
if (typeof state_12 === "object")
|
|
103899
|
+
return state_12.value;
|
|
103908
103900
|
}
|
|
103909
103901
|
}
|
|
103910
103902
|
function validateEnding(_a) {
|