typescript 5.6.0-dev.20240726 → 5.6.0-dev.20240728
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 +7 -3
- package/lib/typescript.js +78 -24
- 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.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240728`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -45471,6 +45471,7 @@ function createTypeChecker(host) {
|
|
|
45471
45471
|
getNonOptionalType: removeOptionalTypeMarker,
|
|
45472
45472
|
getTypeArguments,
|
|
45473
45473
|
typeToTypeNode: nodeBuilder.typeToTypeNode,
|
|
45474
|
+
typePredicateToTypePredicateNode: nodeBuilder.typePredicateToTypePredicateNode,
|
|
45474
45475
|
indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration,
|
|
45475
45476
|
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
|
|
45476
45477
|
symbolToEntityName: nodeBuilder.symbolToEntityName,
|
|
@@ -67789,6 +67790,9 @@ function createTypeChecker(host) {
|
|
|
67789
67790
|
return isTypeAssignableTo(assignedType, reducedType) ? reducedType : declaredType;
|
|
67790
67791
|
}
|
|
67791
67792
|
function isFunctionObjectType(type) {
|
|
67793
|
+
if (getObjectFlags(type) & 256 /* EvolvingArray */) {
|
|
67794
|
+
return false;
|
|
67795
|
+
}
|
|
67792
67796
|
const resolved = resolveStructuredTypeMembers(type);
|
|
67793
67797
|
return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
|
|
67794
67798
|
}
|
|
@@ -103607,7 +103611,7 @@ function transformES2015(context) {
|
|
|
103607
103611
|
statement,
|
|
103608
103612
|
/*outermostLabeledStatement*/
|
|
103609
103613
|
node
|
|
103610
|
-
) : factory2.restoreEnclosingLabel(
|
|
103614
|
+
) : factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock) ?? setTextRange(factory2.createEmptyStatement(), statement), node, convertedLoopState && resetLabel);
|
|
103611
103615
|
}
|
|
103612
103616
|
function visitIterationStatement(node, outermostLabeledStatement) {
|
|
103613
103617
|
switch (node.kind) {
|
|
@@ -107913,7 +107917,7 @@ function transformModule(context) {
|
|
|
107913
107917
|
return factory2.updateLabeledStatement(
|
|
107914
107918
|
node,
|
|
107915
107919
|
node.label,
|
|
107916
|
-
visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ??
|
|
107920
|
+
visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? setTextRange(factory2.createEmptyStatement(), node.statement)
|
|
107917
107921
|
);
|
|
107918
107922
|
}
|
|
107919
107923
|
function visitWithStatement(node) {
|
package/lib/typescript.js
CHANGED
|
@@ -484,6 +484,7 @@ __export(typescript_exports, {
|
|
|
484
484
|
decodeMappings: () => decodeMappings,
|
|
485
485
|
decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith,
|
|
486
486
|
deduplicate: () => deduplicate,
|
|
487
|
+
defaultInitCompilerOptions: () => defaultInitCompilerOptions,
|
|
487
488
|
defaultMaximumTruncationLength: () => defaultMaximumTruncationLength,
|
|
488
489
|
diagnosticCategoryName: () => diagnosticCategoryName,
|
|
489
490
|
diagnosticToString: () => diagnosticToString,
|
|
@@ -2259,7 +2260,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2259
2260
|
|
|
2260
2261
|
// src/compiler/corePublic.ts
|
|
2261
2262
|
var versionMajorMinor = "5.6";
|
|
2262
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2263
|
+
var version = `${versionMajorMinor}.0-dev.20240728`;
|
|
2263
2264
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2264
2265
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2265
2266
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -50089,6 +50090,7 @@ function createTypeChecker(host) {
|
|
|
50089
50090
|
getNonOptionalType: removeOptionalTypeMarker,
|
|
50090
50091
|
getTypeArguments,
|
|
50091
50092
|
typeToTypeNode: nodeBuilder.typeToTypeNode,
|
|
50093
|
+
typePredicateToTypePredicateNode: nodeBuilder.typePredicateToTypePredicateNode,
|
|
50092
50094
|
indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration,
|
|
50093
50095
|
signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration,
|
|
50094
50096
|
symbolToEntityName: nodeBuilder.symbolToEntityName,
|
|
@@ -72407,6 +72409,9 @@ function createTypeChecker(host) {
|
|
|
72407
72409
|
return isTypeAssignableTo(assignedType, reducedType) ? reducedType : declaredType;
|
|
72408
72410
|
}
|
|
72409
72411
|
function isFunctionObjectType(type) {
|
|
72412
|
+
if (getObjectFlags(type) & 256 /* EvolvingArray */) {
|
|
72413
|
+
return false;
|
|
72414
|
+
}
|
|
72410
72415
|
const resolved = resolveStructuredTypeMembers(type);
|
|
72411
72416
|
return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
|
|
72412
72417
|
}
|
|
@@ -108407,7 +108412,7 @@ function transformES2015(context) {
|
|
|
108407
108412
|
statement,
|
|
108408
108413
|
/*outermostLabeledStatement*/
|
|
108409
108414
|
node
|
|
108410
|
-
) : factory2.restoreEnclosingLabel(
|
|
108415
|
+
) : factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock) ?? setTextRange(factory2.createEmptyStatement(), statement), node, convertedLoopState && resetLabel);
|
|
108411
108416
|
}
|
|
108412
108417
|
function visitIterationStatement(node, outermostLabeledStatement) {
|
|
108413
108418
|
switch (node.kind) {
|
|
@@ -112713,7 +112718,7 @@ function transformModule(context) {
|
|
|
112713
112718
|
return factory2.updateLabeledStatement(
|
|
112714
112719
|
node,
|
|
112715
112720
|
node.label,
|
|
112716
|
-
visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ??
|
|
112721
|
+
visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? setTextRange(factory2.createEmptyStatement(), node.statement)
|
|
112717
112722
|
);
|
|
112718
112723
|
}
|
|
112719
112724
|
function visitWithStatement(node) {
|
|
@@ -148186,7 +148191,27 @@ function getInfo4(context) {
|
|
|
148186
148191
|
return { error: getLocaleSpecificMessage(Diagnostics.Return_type_must_be_inferred_from_a_function) };
|
|
148187
148192
|
}
|
|
148188
148193
|
const typeChecker = context.program.getTypeChecker();
|
|
148189
|
-
|
|
148194
|
+
let returnType;
|
|
148195
|
+
if (typeChecker.isImplementationOfOverload(declaration)) {
|
|
148196
|
+
const signatures = typeChecker.getTypeAtLocation(declaration).getCallSignatures();
|
|
148197
|
+
if (signatures.length > 1) {
|
|
148198
|
+
returnType = typeChecker.getUnionType(mapDefined(signatures, (s) => s.getReturnType()));
|
|
148199
|
+
}
|
|
148200
|
+
}
|
|
148201
|
+
if (!returnType) {
|
|
148202
|
+
const signature = typeChecker.getSignatureFromDeclaration(declaration);
|
|
148203
|
+
if (signature) {
|
|
148204
|
+
const typePredicate = typeChecker.getTypePredicateOfSignature(signature);
|
|
148205
|
+
if (typePredicate && typePredicate.type) {
|
|
148206
|
+
const typePredicateTypeNode = typeChecker.typePredicateToTypePredicateNode(typePredicate, declaration, 1 /* NoTruncation */);
|
|
148207
|
+
if (typePredicateTypeNode) {
|
|
148208
|
+
return { declaration, returnTypeNode: typePredicateTypeNode };
|
|
148209
|
+
}
|
|
148210
|
+
} else {
|
|
148211
|
+
returnType = typeChecker.getReturnTypeOfSignature(signature);
|
|
148212
|
+
}
|
|
148213
|
+
}
|
|
148214
|
+
}
|
|
148190
148215
|
if (!returnType) {
|
|
148191
148216
|
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_determine_function_return_type) };
|
|
148192
148217
|
}
|
|
@@ -148206,18 +148231,6 @@ function isConvertibleDeclaration(node) {
|
|
|
148206
148231
|
return false;
|
|
148207
148232
|
}
|
|
148208
148233
|
}
|
|
148209
|
-
function tryGetReturnType(typeChecker, node) {
|
|
148210
|
-
if (typeChecker.isImplementationOfOverload(node)) {
|
|
148211
|
-
const signatures = typeChecker.getTypeAtLocation(node).getCallSignatures();
|
|
148212
|
-
if (signatures.length > 1) {
|
|
148213
|
-
return typeChecker.getUnionType(mapDefined(signatures, (s) => s.getReturnType()));
|
|
148214
|
-
}
|
|
148215
|
-
}
|
|
148216
|
-
const signature = typeChecker.getSignatureFromDeclaration(node);
|
|
148217
|
-
if (signature) {
|
|
148218
|
-
return typeChecker.getReturnTypeOfSignature(signature);
|
|
148219
|
-
}
|
|
148220
|
-
}
|
|
148221
148234
|
|
|
148222
148235
|
// src/services/classifier2020.ts
|
|
148223
148236
|
var TokenEncodingConsts = /* @__PURE__ */ ((TokenEncodingConsts2) => {
|
|
@@ -151763,6 +151776,7 @@ __export(ts_codefix_exports, {
|
|
|
151763
151776
|
setJsonCompilerOptionValue: () => setJsonCompilerOptionValue,
|
|
151764
151777
|
setJsonCompilerOptionValues: () => setJsonCompilerOptionValues,
|
|
151765
151778
|
tryGetAutoImportableReferenceFromTypeNode: () => tryGetAutoImportableReferenceFromTypeNode,
|
|
151779
|
+
typePredicateToAutoImportableTypeNode: () => typePredicateToAutoImportableTypeNode,
|
|
151766
151780
|
typeToAutoImportableTypeNode: () => typeToAutoImportableTypeNode
|
|
151767
151781
|
});
|
|
151768
151782
|
|
|
@@ -159849,7 +159863,25 @@ function withContext(context, typePrintMode, cb) {
|
|
|
159849
159863
|
if (typePrintMode === 1 /* Relative */) {
|
|
159850
159864
|
return relativeType(node);
|
|
159851
159865
|
}
|
|
159852
|
-
let type
|
|
159866
|
+
let type;
|
|
159867
|
+
if (isValueSignatureDeclaration(node)) {
|
|
159868
|
+
const signature = typeChecker.getSignatureFromDeclaration(node);
|
|
159869
|
+
if (signature) {
|
|
159870
|
+
const typePredicate = typeChecker.getTypePredicateOfSignature(signature);
|
|
159871
|
+
if (typePredicate) {
|
|
159872
|
+
if (!typePredicate.type) {
|
|
159873
|
+
return emptyInferenceResult;
|
|
159874
|
+
}
|
|
159875
|
+
return {
|
|
159876
|
+
typeNode: typePredicateToTypeNode(typePredicate, findAncestor(node, isDeclaration) ?? sourceFile, getFlags(typePredicate.type)),
|
|
159877
|
+
mutatedTarget: false
|
|
159878
|
+
};
|
|
159879
|
+
}
|
|
159880
|
+
type = typeChecker.getReturnTypeOfSignature(signature);
|
|
159881
|
+
}
|
|
159882
|
+
} else {
|
|
159883
|
+
type = typeChecker.getTypeAtLocation(node);
|
|
159884
|
+
}
|
|
159853
159885
|
if (!type) {
|
|
159854
159886
|
return emptyInferenceResult;
|
|
159855
159887
|
}
|
|
@@ -159866,11 +159898,13 @@ function withContext(context, typePrintMode, cb) {
|
|
|
159866
159898
|
if (isParameter(node) && typeChecker.requiresAddingImplicitUndefined(node)) {
|
|
159867
159899
|
type = typeChecker.getUnionType([typeChecker.getUndefinedType(), type], 0 /* None */);
|
|
159868
159900
|
}
|
|
159869
|
-
const flags = (isVariableDeclaration(node) || isPropertyDeclaration(node) && hasSyntacticModifier(node, 256 /* Static */ | 8 /* Readonly */)) && type.flags & 8192 /* UniqueESSymbol */ ? 1048576 /* AllowUniqueESSymbolType */ : 0 /* None */;
|
|
159870
159901
|
return {
|
|
159871
|
-
typeNode: typeToTypeNode2(type, findAncestor(node, isDeclaration) ?? sourceFile,
|
|
159902
|
+
typeNode: typeToTypeNode2(type, findAncestor(node, isDeclaration) ?? sourceFile, getFlags(type)),
|
|
159872
159903
|
mutatedTarget: false
|
|
159873
159904
|
};
|
|
159905
|
+
function getFlags(type2) {
|
|
159906
|
+
return (isVariableDeclaration(node) || isPropertyDeclaration(node) && hasSyntacticModifier(node, 256 /* Static */ | 8 /* Readonly */)) && type2.flags & 8192 /* UniqueESSymbol */ ? 1048576 /* AllowUniqueESSymbolType */ : 0 /* None */;
|
|
159907
|
+
}
|
|
159874
159908
|
}
|
|
159875
159909
|
function createTypeOfFromEntityNameExpression(node) {
|
|
159876
159910
|
return factory.createTypeQueryNode(getSynthesizedDeepClone(node));
|
|
@@ -160033,11 +160067,18 @@ function withContext(context, typePrintMode, cb) {
|
|
|
160033
160067
|
});
|
|
160034
160068
|
return isTruncated ? factory.createKeywordTypeNode(133 /* AnyKeyword */) : result2;
|
|
160035
160069
|
}
|
|
160036
|
-
function
|
|
160037
|
-
|
|
160038
|
-
|
|
160039
|
-
|
|
160040
|
-
|
|
160070
|
+
function typePredicateToTypeNode(typePredicate, enclosingDeclaration, flags = 0 /* None */) {
|
|
160071
|
+
let isTruncated = false;
|
|
160072
|
+
const result2 = typePredicateToAutoImportableTypeNode(typeChecker, importAdder, typePredicate, enclosingDeclaration, scriptTarget, declarationEmitNodeBuilderFlags2 | flags, {
|
|
160073
|
+
moduleResolverHost: program,
|
|
160074
|
+
trackSymbol() {
|
|
160075
|
+
return true;
|
|
160076
|
+
},
|
|
160077
|
+
reportTruncationError() {
|
|
160078
|
+
isTruncated = true;
|
|
160079
|
+
}
|
|
160080
|
+
});
|
|
160081
|
+
return isTruncated ? factory.createKeywordTypeNode(133 /* AnyKeyword */) : result2;
|
|
160041
160082
|
}
|
|
160042
160083
|
function addTypeToVariableLike(decl) {
|
|
160043
160084
|
const { typeNode } = inferType(decl);
|
|
@@ -161708,6 +161749,17 @@ function typeToAutoImportableTypeNode(checker, importAdder, type, contextNode, s
|
|
|
161708
161749
|
}
|
|
161709
161750
|
return getSynthesizedDeepClone(typeNode);
|
|
161710
161751
|
}
|
|
161752
|
+
function typePredicateToAutoImportableTypeNode(checker, importAdder, typePredicate, contextNode, scriptTarget, flags, tracker) {
|
|
161753
|
+
let typePredicateNode = checker.typePredicateToTypePredicateNode(typePredicate, contextNode, flags, tracker);
|
|
161754
|
+
if ((typePredicateNode == null ? void 0 : typePredicateNode.type) && isImportTypeNode(typePredicateNode.type)) {
|
|
161755
|
+
const importableReference = tryGetAutoImportableReferenceFromTypeNode(typePredicateNode.type, scriptTarget);
|
|
161756
|
+
if (importableReference) {
|
|
161757
|
+
importSymbols(importAdder, importableReference.symbols);
|
|
161758
|
+
typePredicateNode = factory.updateTypePredicateNode(typePredicateNode, typePredicateNode.assertsModifier, typePredicateNode.parameterName, importableReference.typeNode);
|
|
161759
|
+
}
|
|
161760
|
+
}
|
|
161761
|
+
return getSynthesizedDeepClone(typePredicateNode);
|
|
161762
|
+
}
|
|
161711
161763
|
function typeContainsTypeParameter(type) {
|
|
161712
161764
|
if (type.isUnionOrIntersection()) {
|
|
161713
161765
|
return type.types.some(typeContainsTypeParameter);
|
|
@@ -179430,6 +179482,7 @@ __export(ts_exports2, {
|
|
|
179430
179482
|
decodeMappings: () => decodeMappings,
|
|
179431
179483
|
decodedTextSpanIntersectsWith: () => decodedTextSpanIntersectsWith,
|
|
179432
179484
|
deduplicate: () => deduplicate,
|
|
179485
|
+
defaultInitCompilerOptions: () => defaultInitCompilerOptions,
|
|
179433
179486
|
defaultMaximumTruncationLength: () => defaultMaximumTruncationLength,
|
|
179434
179487
|
diagnosticCategoryName: () => diagnosticCategoryName,
|
|
179435
179488
|
diagnosticToString: () => diagnosticToString,
|
|
@@ -193814,6 +193867,7 @@ if (typeof console !== "undefined") {
|
|
|
193814
193867
|
decodeMappings,
|
|
193815
193868
|
decodedTextSpanIntersectsWith,
|
|
193816
193869
|
deduplicate,
|
|
193870
|
+
defaultInitCompilerOptions,
|
|
193817
193871
|
defaultMaximumTruncationLength,
|
|
193818
193872
|
diagnosticCategoryName,
|
|
193819
193873
|
diagnosticToString,
|
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.20240728",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "9757109cafcb771a35ad9fe09855373cdd82005a"
|
|
118
118
|
}
|