typescript 5.6.0-dev.20240616 → 5.6.0-dev.20240618
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 +18 -14
- package/lib/typescript.d.ts +6 -1
- package/lib/typescript.js +19 -19
- package/package.json +11 -11
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.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240618`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -12445,6 +12445,9 @@ function createSymbolTable(symbols) {
|
|
|
12445
12445
|
function isTransientSymbol(symbol) {
|
|
12446
12446
|
return (symbol.flags & 33554432 /* Transient */) !== 0;
|
|
12447
12447
|
}
|
|
12448
|
+
function isExternalModuleSymbol(moduleSymbol) {
|
|
12449
|
+
return !!(moduleSymbol.flags & 1536 /* Module */) && moduleSymbol.escapedName.charCodeAt(0) === 34 /* doubleQuote */;
|
|
12450
|
+
}
|
|
12448
12451
|
var stringWriter = createSingleLineStringWriter();
|
|
12449
12452
|
function createSingleLineStringWriter() {
|
|
12450
12453
|
var str = "";
|
|
@@ -45452,6 +45455,7 @@ function createTypeChecker(host) {
|
|
|
45452
45455
|
getNumberType: () => numberType,
|
|
45453
45456
|
getNumberLiteralType,
|
|
45454
45457
|
getBigIntType: () => bigintType,
|
|
45458
|
+
getBigIntLiteralType,
|
|
45455
45459
|
createPromiseType,
|
|
45456
45460
|
createArrayType,
|
|
45457
45461
|
getElementTypeOfArrayType,
|
|
@@ -52006,7 +52010,7 @@ function createTypeChecker(host) {
|
|
|
52006
52010
|
/*yieldModuleSymbol*/
|
|
52007
52011
|
true
|
|
52008
52012
|
)[0];
|
|
52009
|
-
if (parentSymbol && parentSymbol
|
|
52013
|
+
if (parentSymbol && isExternalModuleSymbol(parentSymbol)) {
|
|
52010
52014
|
name = getSpecifierForModuleSymbol(parentSymbol, context);
|
|
52011
52015
|
} else {
|
|
52012
52016
|
const targetFile = getExternalModuleFileFromDeclaration(parent);
|
|
@@ -60187,7 +60191,7 @@ function createTypeChecker(host) {
|
|
|
60187
60191
|
}
|
|
60188
60192
|
if (everyType(objectType, isTupleType) && isNumericLiteralName(propName)) {
|
|
60189
60193
|
const index = +propName;
|
|
60190
|
-
if (accessNode && everyType(objectType, (t) => !t.target.
|
|
60194
|
+
if (accessNode && everyType(objectType, (t) => !(t.target.combinedFlags & 12 /* Variable */)) && !(accessFlags & 16 /* NoTupleBoundsCheck */)) {
|
|
60191
60195
|
const indexNode = getIndexNodeForAccessExpression(accessNode);
|
|
60192
60196
|
if (isTupleType(objectType)) {
|
|
60193
60197
|
if (index < 0) {
|
|
@@ -66327,7 +66331,7 @@ function createTypeChecker(host) {
|
|
|
66327
66331
|
return firstOrUndefinedIterator(getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties));
|
|
66328
66332
|
}
|
|
66329
66333
|
function tupleTypesDefinitelyUnrelated(source, target) {
|
|
66330
|
-
return !(target.target.combinedFlags & 8 /* Variadic */) && target.target.minLength > source.target.minLength || !target.target.
|
|
66334
|
+
return !(target.target.combinedFlags & 8 /* Variadic */) && target.target.minLength > source.target.minLength || !(target.target.combinedFlags & 12 /* Variable */) && (!!(source.target.combinedFlags & 12 /* Variable */) || target.target.fixedLength < source.target.fixedLength);
|
|
66331
66335
|
}
|
|
66332
66336
|
function typesDefinitelyUnrelated(source, target) {
|
|
66333
66337
|
return isTupleType(source) && isTupleType(target) ? tupleTypesDefinitelyUnrelated(source, target) : !!getUnmatchedProperty(
|
|
@@ -66945,7 +66949,7 @@ function createTypeChecker(host) {
|
|
|
66945
66949
|
return;
|
|
66946
66950
|
}
|
|
66947
66951
|
const startLength = isTupleType(source) ? Math.min(source.target.fixedLength, target.target.fixedLength) : 0;
|
|
66948
|
-
const endLength = Math.min(isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0, target.target.
|
|
66952
|
+
const endLength = Math.min(isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0, target.target.combinedFlags & 12 /* Variable */ ? getEndElementCount(target.target, 3 /* Fixed */) : 0);
|
|
66949
66953
|
for (let i = 0; i < startLength; i++) {
|
|
66950
66954
|
inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);
|
|
66951
66955
|
}
|
|
@@ -66966,7 +66970,7 @@ function createTypeChecker(host) {
|
|
|
66966
66970
|
} else if (elementFlags[startLength] & 8 /* Variadic */ && elementFlags[startLength + 1] & 4 /* Rest */) {
|
|
66967
66971
|
const param = (_a = getInferenceInfoForType(elementTypes[startLength])) == null ? void 0 : _a.typeParameter;
|
|
66968
66972
|
const constraint = param && getBaseConstraintOfType(param);
|
|
66969
|
-
if (constraint && isTupleType(constraint) && !constraint.target.
|
|
66973
|
+
if (constraint && isTupleType(constraint) && !(constraint.target.combinedFlags & 12 /* Variable */)) {
|
|
66970
66974
|
const impliedArity = constraint.target.fixedLength;
|
|
66971
66975
|
inferFromTypes(sliceTupleType(source, startLength, sourceArity - (startLength + impliedArity)), elementTypes[startLength]);
|
|
66972
66976
|
inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength + impliedArity, endLength), elementTypes[startLength + 1]);
|
|
@@ -66974,7 +66978,7 @@ function createTypeChecker(host) {
|
|
|
66974
66978
|
} else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */) {
|
|
66975
66979
|
const param = (_b = getInferenceInfoForType(elementTypes[startLength + 1])) == null ? void 0 : _b.typeParameter;
|
|
66976
66980
|
const constraint = param && getBaseConstraintOfType(param);
|
|
66977
|
-
if (constraint && isTupleType(constraint) && !constraint.target.
|
|
66981
|
+
if (constraint && isTupleType(constraint) && !(constraint.target.combinedFlags & 12 /* Variable */)) {
|
|
66978
66982
|
const impliedArity = constraint.target.fixedLength;
|
|
66979
66983
|
const endIndex = sourceArity - getEndElementCount(target.target, 3 /* Fixed */);
|
|
66980
66984
|
const startIndex = endIndex - impliedArity;
|
|
@@ -67126,7 +67130,7 @@ function createTypeChecker(host) {
|
|
|
67126
67130
|
const inferredCovariantType = inference.candidates ? getCovariantInference(inference, context.signature) : void 0;
|
|
67127
67131
|
const inferredContravariantType = inference.contraCandidates ? getContravariantInference(inference) : void 0;
|
|
67128
67132
|
if (inferredCovariantType || inferredContravariantType) {
|
|
67129
|
-
const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) =>
|
|
67133
|
+
const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & (131072 /* Never */ | 1 /* Any */)) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType))));
|
|
67130
67134
|
inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
|
|
67131
67135
|
fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
|
|
67132
67136
|
} else if (context.flags & 1 /* NoDefault */) {
|
|
@@ -70985,7 +70989,7 @@ function createTypeChecker(host) {
|
|
|
70985
70989
|
return removeMissingType(getTypeArguments(t)[index], !!(t.target.elementFlags[index] && 2 /* Optional */));
|
|
70986
70990
|
}
|
|
70987
70991
|
const offset = length2 !== void 0 && (lastSpreadIndex === void 0 || index > lastSpreadIndex) ? length2 - index : 0;
|
|
70988
|
-
const fixedEndLength = offset > 0 && t.target.
|
|
70992
|
+
const fixedEndLength = offset > 0 && t.target.combinedFlags & 12 /* Variable */ ? getEndElementCount(t.target, 3 /* Fixed */) : 0;
|
|
70989
70993
|
if (offset > 0 && offset <= fixedEndLength) {
|
|
70990
70994
|
return getTypeArguments(t)[getTypeReferenceArity(t) - offset];
|
|
70991
70995
|
}
|
|
@@ -75815,7 +75819,7 @@ function createTypeChecker(host) {
|
|
|
75815
75819
|
if (signatureHasRestParameter(signature)) {
|
|
75816
75820
|
const restType = getTypeOfSymbol(signature.parameters[paramCount]);
|
|
75817
75821
|
const index = pos - paramCount;
|
|
75818
|
-
if (!isTupleType(restType) || restType.target.
|
|
75822
|
+
if (!isTupleType(restType) || restType.target.combinedFlags & 12 /* Variable */ || index < restType.target.fixedLength) {
|
|
75819
75823
|
return getIndexedAccessType(restType, getNumberLiteralType(index));
|
|
75820
75824
|
}
|
|
75821
75825
|
}
|
|
@@ -75853,7 +75857,7 @@ function createTypeChecker(host) {
|
|
|
75853
75857
|
if (signatureHasRestParameter(signature)) {
|
|
75854
75858
|
const restType = getTypeOfSymbol(signature.parameters[length2 - 1]);
|
|
75855
75859
|
if (isTupleType(restType)) {
|
|
75856
|
-
return length2 + restType.target.fixedLength - (restType.target.
|
|
75860
|
+
return length2 + restType.target.fixedLength - (restType.target.combinedFlags & 12 /* Variable */ ? 0 : 1);
|
|
75857
75861
|
}
|
|
75858
75862
|
}
|
|
75859
75863
|
return length2;
|
|
@@ -75896,7 +75900,7 @@ function createTypeChecker(host) {
|
|
|
75896
75900
|
function hasEffectiveRestParameter(signature) {
|
|
75897
75901
|
if (signatureHasRestParameter(signature)) {
|
|
75898
75902
|
const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);
|
|
75899
|
-
return !isTupleType(restType) || restType.target.
|
|
75903
|
+
return !isTupleType(restType) || !!(restType.target.combinedFlags & 12 /* Variable */);
|
|
75900
75904
|
}
|
|
75901
75905
|
return false;
|
|
75902
75906
|
}
|
|
@@ -75906,7 +75910,7 @@ function createTypeChecker(host) {
|
|
|
75906
75910
|
if (!isTupleType(restType)) {
|
|
75907
75911
|
return isTypeAny(restType) ? anyArrayType : restType;
|
|
75908
75912
|
}
|
|
75909
|
-
if (restType.target.
|
|
75913
|
+
if (restType.target.combinedFlags & 12 /* Variable */) {
|
|
75910
75914
|
return sliceTupleType(restType, restType.target.fixedLength);
|
|
75911
75915
|
}
|
|
75912
75916
|
}
|
|
@@ -78111,7 +78115,7 @@ function createTypeChecker(host) {
|
|
|
78111
78115
|
void 0,
|
|
78112
78116
|
checkMode || 0 /* Normal */
|
|
78113
78117
|
) : checkExpressionCached(initializer, checkMode));
|
|
78114
|
-
return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.
|
|
78118
|
+
return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !(type.target.combinedFlags & 12 /* Variable */) && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
|
|
78115
78119
|
}
|
|
78116
78120
|
function padTupleType(type, pattern) {
|
|
78117
78121
|
const patternElements = pattern.elements;
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6196,6 +6196,7 @@ declare namespace ts {
|
|
|
6196
6196
|
getNumberType(): Type;
|
|
6197
6197
|
getNumberLiteralType(value: number): NumberLiteralType;
|
|
6198
6198
|
getBigIntType(): Type;
|
|
6199
|
+
getBigIntLiteralType(value: PseudoBigInt): BigIntLiteralType;
|
|
6199
6200
|
getBooleanType(): Type;
|
|
6200
6201
|
getFalseType(): Type;
|
|
6201
6202
|
getTrueType(): Type;
|
|
@@ -6665,7 +6666,11 @@ declare namespace ts {
|
|
|
6665
6666
|
minLength: number;
|
|
6666
6667
|
/** Number of initial required or optional elements */
|
|
6667
6668
|
fixedLength: number;
|
|
6668
|
-
/**
|
|
6669
|
+
/**
|
|
6670
|
+
* True if tuple has any rest or variadic elements
|
|
6671
|
+
*
|
|
6672
|
+
* @deprecated Use `.combinedFlags & ElementFlags.Variable` instead
|
|
6673
|
+
*/
|
|
6669
6674
|
hasRestElement: boolean;
|
|
6670
6675
|
combinedFlags: ElementFlags;
|
|
6671
6676
|
readonly: boolean;
|
package/lib/typescript.js
CHANGED
|
@@ -2377,7 +2377,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2377
2377
|
|
|
2378
2378
|
// src/compiler/corePublic.ts
|
|
2379
2379
|
var versionMajorMinor = "5.6";
|
|
2380
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2380
|
+
var version = `${versionMajorMinor}.0-dev.20240618`;
|
|
2381
2381
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2382
2382
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2383
2383
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -16253,6 +16253,9 @@ function createSymbolTable(symbols) {
|
|
|
16253
16253
|
function isTransientSymbol(symbol) {
|
|
16254
16254
|
return (symbol.flags & 33554432 /* Transient */) !== 0;
|
|
16255
16255
|
}
|
|
16256
|
+
function isExternalModuleSymbol(moduleSymbol) {
|
|
16257
|
+
return !!(moduleSymbol.flags & 1536 /* Module */) && moduleSymbol.escapedName.charCodeAt(0) === 34 /* doubleQuote */;
|
|
16258
|
+
}
|
|
16256
16259
|
var stringWriter = createSingleLineStringWriter();
|
|
16257
16260
|
function createSingleLineStringWriter() {
|
|
16258
16261
|
var str = "";
|
|
@@ -50355,6 +50358,7 @@ function createTypeChecker(host) {
|
|
|
50355
50358
|
getNumberType: () => numberType,
|
|
50356
50359
|
getNumberLiteralType,
|
|
50357
50360
|
getBigIntType: () => bigintType,
|
|
50361
|
+
getBigIntLiteralType,
|
|
50358
50362
|
createPromiseType,
|
|
50359
50363
|
createArrayType,
|
|
50360
50364
|
getElementTypeOfArrayType,
|
|
@@ -56909,7 +56913,7 @@ function createTypeChecker(host) {
|
|
|
56909
56913
|
/*yieldModuleSymbol*/
|
|
56910
56914
|
true
|
|
56911
56915
|
)[0];
|
|
56912
|
-
if (parentSymbol && parentSymbol
|
|
56916
|
+
if (parentSymbol && isExternalModuleSymbol(parentSymbol)) {
|
|
56913
56917
|
name = getSpecifierForModuleSymbol(parentSymbol, context);
|
|
56914
56918
|
} else {
|
|
56915
56919
|
const targetFile = getExternalModuleFileFromDeclaration(parent2);
|
|
@@ -65090,7 +65094,7 @@ function createTypeChecker(host) {
|
|
|
65090
65094
|
}
|
|
65091
65095
|
if (everyType(objectType, isTupleType) && isNumericLiteralName(propName)) {
|
|
65092
65096
|
const index = +propName;
|
|
65093
|
-
if (accessNode && everyType(objectType, (t) => !t.target.
|
|
65097
|
+
if (accessNode && everyType(objectType, (t) => !(t.target.combinedFlags & 12 /* Variable */)) && !(accessFlags & 16 /* NoTupleBoundsCheck */)) {
|
|
65094
65098
|
const indexNode = getIndexNodeForAccessExpression(accessNode);
|
|
65095
65099
|
if (isTupleType(objectType)) {
|
|
65096
65100
|
if (index < 0) {
|
|
@@ -71230,7 +71234,7 @@ function createTypeChecker(host) {
|
|
|
71230
71234
|
return firstOrUndefinedIterator(getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties));
|
|
71231
71235
|
}
|
|
71232
71236
|
function tupleTypesDefinitelyUnrelated(source, target) {
|
|
71233
|
-
return !(target.target.combinedFlags & 8 /* Variadic */) && target.target.minLength > source.target.minLength || !target.target.
|
|
71237
|
+
return !(target.target.combinedFlags & 8 /* Variadic */) && target.target.minLength > source.target.minLength || !(target.target.combinedFlags & 12 /* Variable */) && (!!(source.target.combinedFlags & 12 /* Variable */) || target.target.fixedLength < source.target.fixedLength);
|
|
71234
71238
|
}
|
|
71235
71239
|
function typesDefinitelyUnrelated(source, target) {
|
|
71236
71240
|
return isTupleType(source) && isTupleType(target) ? tupleTypesDefinitelyUnrelated(source, target) : !!getUnmatchedProperty(
|
|
@@ -71848,7 +71852,7 @@ function createTypeChecker(host) {
|
|
|
71848
71852
|
return;
|
|
71849
71853
|
}
|
|
71850
71854
|
const startLength = isTupleType(source) ? Math.min(source.target.fixedLength, target.target.fixedLength) : 0;
|
|
71851
|
-
const endLength = Math.min(isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0, target.target.
|
|
71855
|
+
const endLength = Math.min(isTupleType(source) ? getEndElementCount(source.target, 3 /* Fixed */) : 0, target.target.combinedFlags & 12 /* Variable */ ? getEndElementCount(target.target, 3 /* Fixed */) : 0);
|
|
71852
71856
|
for (let i = 0; i < startLength; i++) {
|
|
71853
71857
|
inferFromTypes(getTypeArguments(source)[i], elementTypes[i]);
|
|
71854
71858
|
}
|
|
@@ -71869,7 +71873,7 @@ function createTypeChecker(host) {
|
|
|
71869
71873
|
} else if (elementFlags[startLength] & 8 /* Variadic */ && elementFlags[startLength + 1] & 4 /* Rest */) {
|
|
71870
71874
|
const param = (_a = getInferenceInfoForType(elementTypes[startLength])) == null ? void 0 : _a.typeParameter;
|
|
71871
71875
|
const constraint = param && getBaseConstraintOfType(param);
|
|
71872
|
-
if (constraint && isTupleType(constraint) && !constraint.target.
|
|
71876
|
+
if (constraint && isTupleType(constraint) && !(constraint.target.combinedFlags & 12 /* Variable */)) {
|
|
71873
71877
|
const impliedArity = constraint.target.fixedLength;
|
|
71874
71878
|
inferFromTypes(sliceTupleType(source, startLength, sourceArity - (startLength + impliedArity)), elementTypes[startLength]);
|
|
71875
71879
|
inferFromTypes(getElementTypeOfSliceOfTupleType(source, startLength + impliedArity, endLength), elementTypes[startLength + 1]);
|
|
@@ -71877,7 +71881,7 @@ function createTypeChecker(host) {
|
|
|
71877
71881
|
} else if (elementFlags[startLength] & 4 /* Rest */ && elementFlags[startLength + 1] & 8 /* Variadic */) {
|
|
71878
71882
|
const param = (_b = getInferenceInfoForType(elementTypes[startLength + 1])) == null ? void 0 : _b.typeParameter;
|
|
71879
71883
|
const constraint = param && getBaseConstraintOfType(param);
|
|
71880
|
-
if (constraint && isTupleType(constraint) && !constraint.target.
|
|
71884
|
+
if (constraint && isTupleType(constraint) && !(constraint.target.combinedFlags & 12 /* Variable */)) {
|
|
71881
71885
|
const impliedArity = constraint.target.fixedLength;
|
|
71882
71886
|
const endIndex = sourceArity - getEndElementCount(target.target, 3 /* Fixed */);
|
|
71883
71887
|
const startIndex = endIndex - impliedArity;
|
|
@@ -72029,7 +72033,7 @@ function createTypeChecker(host) {
|
|
|
72029
72033
|
const inferredCovariantType = inference.candidates ? getCovariantInference(inference, context.signature) : void 0;
|
|
72030
72034
|
const inferredContravariantType = inference.contraCandidates ? getContravariantInference(inference) : void 0;
|
|
72031
72035
|
if (inferredCovariantType || inferredContravariantType) {
|
|
72032
|
-
const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) =>
|
|
72036
|
+
const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & (131072 /* Never */ | 1 /* Any */)) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType))));
|
|
72033
72037
|
inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
|
|
72034
72038
|
fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
|
|
72035
72039
|
} else if (context.flags & 1 /* NoDefault */) {
|
|
@@ -75888,7 +75892,7 @@ function createTypeChecker(host) {
|
|
|
75888
75892
|
return removeMissingType(getTypeArguments(t)[index], !!(t.target.elementFlags[index] && 2 /* Optional */));
|
|
75889
75893
|
}
|
|
75890
75894
|
const offset = length2 !== void 0 && (lastSpreadIndex === void 0 || index > lastSpreadIndex) ? length2 - index : 0;
|
|
75891
|
-
const fixedEndLength = offset > 0 && t.target.
|
|
75895
|
+
const fixedEndLength = offset > 0 && t.target.combinedFlags & 12 /* Variable */ ? getEndElementCount(t.target, 3 /* Fixed */) : 0;
|
|
75892
75896
|
if (offset > 0 && offset <= fixedEndLength) {
|
|
75893
75897
|
return getTypeArguments(t)[getTypeReferenceArity(t) - offset];
|
|
75894
75898
|
}
|
|
@@ -80718,7 +80722,7 @@ function createTypeChecker(host) {
|
|
|
80718
80722
|
if (signatureHasRestParameter(signature)) {
|
|
80719
80723
|
const restType = getTypeOfSymbol(signature.parameters[paramCount]);
|
|
80720
80724
|
const index = pos - paramCount;
|
|
80721
|
-
if (!isTupleType(restType) || restType.target.
|
|
80725
|
+
if (!isTupleType(restType) || restType.target.combinedFlags & 12 /* Variable */ || index < restType.target.fixedLength) {
|
|
80722
80726
|
return getIndexedAccessType(restType, getNumberLiteralType(index));
|
|
80723
80727
|
}
|
|
80724
80728
|
}
|
|
@@ -80756,7 +80760,7 @@ function createTypeChecker(host) {
|
|
|
80756
80760
|
if (signatureHasRestParameter(signature)) {
|
|
80757
80761
|
const restType = getTypeOfSymbol(signature.parameters[length2 - 1]);
|
|
80758
80762
|
if (isTupleType(restType)) {
|
|
80759
|
-
return length2 + restType.target.fixedLength - (restType.target.
|
|
80763
|
+
return length2 + restType.target.fixedLength - (restType.target.combinedFlags & 12 /* Variable */ ? 0 : 1);
|
|
80760
80764
|
}
|
|
80761
80765
|
}
|
|
80762
80766
|
return length2;
|
|
@@ -80799,7 +80803,7 @@ function createTypeChecker(host) {
|
|
|
80799
80803
|
function hasEffectiveRestParameter(signature) {
|
|
80800
80804
|
if (signatureHasRestParameter(signature)) {
|
|
80801
80805
|
const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);
|
|
80802
|
-
return !isTupleType(restType) || restType.target.
|
|
80806
|
+
return !isTupleType(restType) || !!(restType.target.combinedFlags & 12 /* Variable */);
|
|
80803
80807
|
}
|
|
80804
80808
|
return false;
|
|
80805
80809
|
}
|
|
@@ -80809,7 +80813,7 @@ function createTypeChecker(host) {
|
|
|
80809
80813
|
if (!isTupleType(restType)) {
|
|
80810
80814
|
return isTypeAny(restType) ? anyArrayType : restType;
|
|
80811
80815
|
}
|
|
80812
|
-
if (restType.target.
|
|
80816
|
+
if (restType.target.combinedFlags & 12 /* Variable */) {
|
|
80813
80817
|
return sliceTupleType(restType, restType.target.fixedLength);
|
|
80814
80818
|
}
|
|
80815
80819
|
}
|
|
@@ -83014,7 +83018,7 @@ function createTypeChecker(host) {
|
|
|
83014
83018
|
void 0,
|
|
83015
83019
|
checkMode || 0 /* Normal */
|
|
83016
83020
|
) : checkExpressionCached(initializer, checkMode));
|
|
83017
|
-
return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !type.target.
|
|
83021
|
+
return isParameter(declaration) && declaration.name.kind === 207 /* ArrayBindingPattern */ && isTupleType(type) && !(type.target.combinedFlags & 12 /* Variable */) && getTypeReferenceArity(type) < declaration.name.elements.length ? padTupleType(type, declaration.name) : type;
|
|
83018
83022
|
}
|
|
83019
83023
|
function padTupleType(type, pattern) {
|
|
83020
83024
|
const patternElements = pattern.elements;
|
|
@@ -137179,9 +137183,6 @@ function isTypeKeywordToken(node) {
|
|
|
137179
137183
|
function isTypeKeywordTokenOrIdentifier(node) {
|
|
137180
137184
|
return isTypeKeywordToken(node) || isIdentifier(node) && node.text === "type";
|
|
137181
137185
|
}
|
|
137182
|
-
function isExternalModuleSymbol(moduleSymbol) {
|
|
137183
|
-
return !!(moduleSymbol.flags & 1536 /* Module */) && moduleSymbol.name.charCodeAt(0) === 34 /* doubleQuote */;
|
|
137184
|
-
}
|
|
137185
137186
|
function nodeSeenTracker() {
|
|
137186
137187
|
const seen = [];
|
|
137187
137188
|
return (node) => {
|
|
@@ -195455,6 +195456,5 @@ if (typeof console !== "undefined") {
|
|
|
195455
195456
|
writeFileEnsuringDirectories,
|
|
195456
195457
|
zipWith
|
|
195457
195458
|
});
|
|
195458
|
-
})(typeof module !== "undefined" && module.exports
|
|
195459
|
-
if (typeof module !== "undefined" && module.exports) { ts = module.exports; }
|
|
195459
|
+
})({ get exports() { return ts; }, set exports(v) { ts = v; if (typeof module !== "undefined" && module.exports) { module.exports = v; } } })
|
|
195460
195460
|
//# sourceMappingURL=typescript.js.map
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.6.0-dev.
|
|
5
|
+
"version": "5.6.0-dev.20240618",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@dprint/formatter": "^0.3.0",
|
|
43
|
-
"@dprint/typescript": "0.91.
|
|
43
|
+
"@dprint/typescript": "0.91.1",
|
|
44
44
|
"@esfx/canceltoken": "^1.0.0",
|
|
45
45
|
"@octokit/rest": "^20.1.1",
|
|
46
46
|
"@types/chai": "^4.3.16",
|
|
@@ -49,18 +49,18 @@
|
|
|
49
49
|
"@types/ms": "^0.7.34",
|
|
50
50
|
"@types/node": "latest",
|
|
51
51
|
"@types/source-map-support": "^0.5.10",
|
|
52
|
-
"@types/which": "^3.0.
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
54
|
-
"@typescript-eslint/parser": "^7.
|
|
55
|
-
"@typescript-eslint/utils": "^7.
|
|
52
|
+
"@types/which": "^3.0.4",
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
|
54
|
+
"@typescript-eslint/parser": "^7.13.1",
|
|
55
|
+
"@typescript-eslint/utils": "^7.13.1",
|
|
56
56
|
"azure-devops-node-api": "^13.0.0",
|
|
57
|
-
"c8": "^
|
|
57
|
+
"c8": "^10.1.2",
|
|
58
58
|
"chai": "^4.4.1",
|
|
59
59
|
"chalk": "^4.1.2",
|
|
60
60
|
"chokidar": "^3.6.0",
|
|
61
61
|
"diff": "^5.2.0",
|
|
62
|
-
"dprint": "^0.46.
|
|
63
|
-
"esbuild": "^0.21.
|
|
62
|
+
"dprint": "^0.46.3",
|
|
63
|
+
"esbuild": "^0.21.5",
|
|
64
64
|
"eslint": "^8.57.0",
|
|
65
65
|
"eslint-formatter-autolinkable-stylish": "^1.3.0",
|
|
66
66
|
"eslint-plugin-local": "^4.2.2",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"node-fetch": "^3.3.2",
|
|
76
76
|
"playwright": "^1.44.1",
|
|
77
77
|
"source-map-support": "^0.5.21",
|
|
78
|
-
"tslib": "^2.6.
|
|
78
|
+
"tslib": "^2.6.3",
|
|
79
79
|
"typescript": "^5.4.5",
|
|
80
80
|
"which": "^3.0.1"
|
|
81
81
|
},
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"node": "20.1.0",
|
|
111
111
|
"npm": "8.19.4"
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "fb88f027b015d95816e91f6b4f0e67dc57fa7a9f"
|
|
114
114
|
}
|