typescript 5.6.0-dev.20240709 → 5.6.0-dev.20240710
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 +10 -6
- package/lib/typescript.js +16 -8
- 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.20240710`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -51440,9 +51440,9 @@ function createTypeChecker(host) {
|
|
|
51440
51440
|
const typePredicate = getTypePredicateOfSignature(signature);
|
|
51441
51441
|
const type = getReturnTypeOfSignature(signature);
|
|
51442
51442
|
if (context.enclosingDeclaration && (!isErrorType(type) || context.flags & 1 /* AllowUnresolvedNames */) && signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
51443
|
-
const annotation =
|
|
51444
|
-
if (annotation
|
|
51445
|
-
const result =
|
|
51443
|
+
const annotation = getNonlocalEffectiveReturnTypeAnnotationNode(signature.declaration);
|
|
51444
|
+
if (annotation) {
|
|
51445
|
+
const result = tryReuseExistingTypeNode(context, annotation, type, context.enclosingDeclaration);
|
|
51446
51446
|
if (result) {
|
|
51447
51447
|
return result;
|
|
51448
51448
|
}
|
|
@@ -51936,7 +51936,10 @@ function createTypeChecker(host) {
|
|
|
51936
51936
|
);
|
|
51937
51937
|
}
|
|
51938
51938
|
if (isNamedDeclaration(node) && node.name.kind === 167 /* ComputedPropertyName */ && !isLateBindableName(node.name)) {
|
|
51939
|
-
if (!
|
|
51939
|
+
if (!hasDynamicName(node)) {
|
|
51940
|
+
return visitEachChild2(node, visitExistingNodeTreeSymbols);
|
|
51941
|
+
}
|
|
51942
|
+
if (!(context.flags & 1 /* AllowUnresolvedNames */ && isEntityNameExpression(node.name.expression) && checkComputedPropertyName(node.name).flags & 1 /* Any */)) {
|
|
51940
51943
|
return void 0;
|
|
51941
51944
|
}
|
|
51942
51945
|
}
|
|
@@ -58027,7 +58030,7 @@ function createTypeChecker(host) {
|
|
|
58027
58030
|
);
|
|
58028
58031
|
}
|
|
58029
58032
|
function createSignatureTypeMapper(signature, typeArguments) {
|
|
58030
|
-
return createTypeMapper(signature.typeParameters, typeArguments);
|
|
58033
|
+
return createTypeMapper(sameMap(signature.typeParameters, (tp) => tp.mapper ? instantiateType(tp, tp.mapper) : tp), typeArguments);
|
|
58031
58034
|
}
|
|
58032
58035
|
function getErasedSignature(signature) {
|
|
58033
58036
|
return signature.typeParameters ? signature.erasedSignatureCache || (signature.erasedSignatureCache = createErasedSignature(signature)) : signature;
|
|
@@ -110992,6 +110995,7 @@ function transformDeclarations(context) {
|
|
|
110992
110995
|
}
|
|
110993
110996
|
function reportInferenceFallback(node) {
|
|
110994
110997
|
if (!isolatedDeclarations || isSourceFileJS(currentSourceFile)) return;
|
|
110998
|
+
if (getSourceFileOfNode(node) !== currentSourceFile) return;
|
|
110995
110999
|
if (isVariableDeclaration(node) && resolver.isExpandoFunctionDeclaration(node)) {
|
|
110996
111000
|
reportExpandoFunctionErrors(node);
|
|
110997
111001
|
} else {
|
package/lib/typescript.js
CHANGED
|
@@ -2251,7 +2251,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2251
2251
|
|
|
2252
2252
|
// src/compiler/corePublic.ts
|
|
2253
2253
|
var versionMajorMinor = "5.6";
|
|
2254
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2254
|
+
var version = `${versionMajorMinor}.0-dev.20240710`;
|
|
2255
2255
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2256
2256
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2257
2257
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -56041,9 +56041,9 @@ function createTypeChecker(host) {
|
|
|
56041
56041
|
const typePredicate = getTypePredicateOfSignature(signature);
|
|
56042
56042
|
const type = getReturnTypeOfSignature(signature);
|
|
56043
56043
|
if (context.enclosingDeclaration && (!isErrorType(type) || context.flags & 1 /* AllowUnresolvedNames */) && signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
56044
|
-
const annotation =
|
|
56045
|
-
if (annotation
|
|
56046
|
-
const result =
|
|
56044
|
+
const annotation = getNonlocalEffectiveReturnTypeAnnotationNode(signature.declaration);
|
|
56045
|
+
if (annotation) {
|
|
56046
|
+
const result = tryReuseExistingTypeNode(context, annotation, type, context.enclosingDeclaration);
|
|
56047
56047
|
if (result) {
|
|
56048
56048
|
return result;
|
|
56049
56049
|
}
|
|
@@ -56537,7 +56537,10 @@ function createTypeChecker(host) {
|
|
|
56537
56537
|
);
|
|
56538
56538
|
}
|
|
56539
56539
|
if (isNamedDeclaration(node) && node.name.kind === 167 /* ComputedPropertyName */ && !isLateBindableName(node.name)) {
|
|
56540
|
-
if (!
|
|
56540
|
+
if (!hasDynamicName(node)) {
|
|
56541
|
+
return visitEachChild2(node, visitExistingNodeTreeSymbols);
|
|
56542
|
+
}
|
|
56543
|
+
if (!(context.flags & 1 /* AllowUnresolvedNames */ && isEntityNameExpression(node.name.expression) && checkComputedPropertyName(node.name).flags & 1 /* Any */)) {
|
|
56541
56544
|
return void 0;
|
|
56542
56545
|
}
|
|
56543
56546
|
}
|
|
@@ -62628,7 +62631,7 @@ function createTypeChecker(host) {
|
|
|
62628
62631
|
);
|
|
62629
62632
|
}
|
|
62630
62633
|
function createSignatureTypeMapper(signature, typeArguments) {
|
|
62631
|
-
return createTypeMapper(signature.typeParameters, typeArguments);
|
|
62634
|
+
return createTypeMapper(sameMap(signature.typeParameters, (tp) => tp.mapper ? instantiateType(tp, tp.mapper) : tp), typeArguments);
|
|
62632
62635
|
}
|
|
62633
62636
|
function getErasedSignature(signature) {
|
|
62634
62637
|
return signature.typeParameters ? signature.erasedSignatureCache || (signature.erasedSignatureCache = createErasedSignature(signature)) : signature;
|
|
@@ -115775,6 +115778,7 @@ function transformDeclarations(context) {
|
|
|
115775
115778
|
}
|
|
115776
115779
|
function reportInferenceFallback(node) {
|
|
115777
115780
|
if (!isolatedDeclarations || isSourceFileJS(currentSourceFile)) return;
|
|
115781
|
+
if (getSourceFileOfNode(node) !== currentSourceFile) return;
|
|
115778
115782
|
if (isVariableDeclaration(node) && resolver.isExpandoFunctionDeclaration(node)) {
|
|
115779
115783
|
reportExpandoFunctionErrors(node);
|
|
115780
115784
|
} else {
|
|
@@ -167977,7 +167981,7 @@ function getContainingModuleSymbol(importer, checker) {
|
|
|
167977
167981
|
return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol);
|
|
167978
167982
|
}
|
|
167979
167983
|
function getSourceFileLikeForImportDeclaration(node) {
|
|
167980
|
-
if (node.kind === 213 /* CallExpression */) {
|
|
167984
|
+
if (node.kind === 213 /* CallExpression */ || node.kind === 351 /* JSDocImportTag */) {
|
|
167981
167985
|
return node.getSourceFile();
|
|
167982
167986
|
}
|
|
167983
167987
|
const { parent: parent2 } = node;
|
|
@@ -178434,8 +178438,9 @@ function pasteEdits(targetFile, pastedText, pasteLocations, copiedFrom, host, pr
|
|
|
178434
178438
|
const { pos, end } = pasteLocations[i];
|
|
178435
178439
|
newText = actualPastedText ? newText.slice(0, pos) + actualPastedText[0] + newText.slice(end) : newText.slice(0, pos) + pastedText[i] + newText.slice(end);
|
|
178436
178440
|
}
|
|
178441
|
+
let importAdder;
|
|
178437
178442
|
Debug.checkDefined(host.runWithTemporaryFileUpdate).call(host, targetFile.fileName, newText, (updatedProgram, originalProgram, updatedFile) => {
|
|
178438
|
-
|
|
178443
|
+
importAdder = ts_codefix_exports.createImportAdder(updatedFile, updatedProgram, preferences, host);
|
|
178439
178444
|
if (copiedFrom == null ? void 0 : copiedFrom.range) {
|
|
178440
178445
|
Debug.assert(copiedFrom.range.length === pastedText.length);
|
|
178441
178446
|
copiedFrom.range.forEach((copy) => {
|
|
@@ -178482,6 +178487,9 @@ function pasteEdits(targetFile, pastedText, pasteLocations, copiedFrom, host, pr
|
|
|
178482
178487
|
}
|
|
178483
178488
|
importAdder.writeFixes(changes, getQuotePreference(copiedFrom ? copiedFrom.file : targetFile, preferences));
|
|
178484
178489
|
});
|
|
178490
|
+
if (!importAdder.hasFixes()) {
|
|
178491
|
+
return;
|
|
178492
|
+
}
|
|
178485
178493
|
pasteLocations.forEach((paste, i) => {
|
|
178486
178494
|
changes.replaceRangeWithText(
|
|
178487
178495
|
targetFile,
|
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.20240710",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"node": "20.1.0",
|
|
114
114
|
"npm": "8.19.4"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "a6a0f4ad58fc0d1a66c4a844dbeb53a855c13ab5"
|
|
117
117
|
}
|