@typescript-deploys/pr-build 5.5.0-pr-57465-61 → 5.5.0-pr-57267-6
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 +4 -93
- package/lib/tsserver.js +286 -309
- package/lib/typescript.js +284 -310
- package/lib/typingsInstaller.js +1 -1
- 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.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240227`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -56016,15 +56016,7 @@ function createTypeChecker(host) {
|
|
|
56016
56016
|
jsdocPredicate = getTypePredicateOfSignature(jsdocSignature);
|
|
56017
56017
|
}
|
|
56018
56018
|
}
|
|
56019
|
-
|
|
56020
|
-
signature.resolvedTypePredicate = type && isTypePredicateNode(type) ? createTypePredicateFromTypePredicateNode(type, signature) : jsdocPredicate || noTypePredicate;
|
|
56021
|
-
} else if (signature.declaration && isFunctionLikeDeclaration(signature.declaration) && (!signature.resolvedReturnType || signature.resolvedReturnType === booleanType)) {
|
|
56022
|
-
const { declaration } = signature;
|
|
56023
|
-
signature.resolvedTypePredicate = noTypePredicate;
|
|
56024
|
-
signature.resolvedTypePredicate = getTypePredicateFromBody(declaration) || noTypePredicate;
|
|
56025
|
-
} else {
|
|
56026
|
-
signature.resolvedTypePredicate = noTypePredicate;
|
|
56027
|
-
}
|
|
56019
|
+
signature.resolvedTypePredicate = type && isTypePredicateNode(type) ? createTypePredicateFromTypePredicateNode(type, signature) : jsdocPredicate || noTypePredicate;
|
|
56028
56020
|
}
|
|
56029
56021
|
Debug.assert(!!signature.resolvedTypePredicate);
|
|
56030
56022
|
}
|
|
@@ -74433,87 +74425,6 @@ function createTypeChecker(host) {
|
|
|
74433
74425
|
return false;
|
|
74434
74426
|
}
|
|
74435
74427
|
}
|
|
74436
|
-
function getTypePredicateFromBody(func) {
|
|
74437
|
-
switch (func.kind) {
|
|
74438
|
-
case 176 /* Constructor */:
|
|
74439
|
-
case 177 /* GetAccessor */:
|
|
74440
|
-
case 178 /* SetAccessor */:
|
|
74441
|
-
return void 0;
|
|
74442
|
-
}
|
|
74443
|
-
const functionFlags = getFunctionFlags(func);
|
|
74444
|
-
if (functionFlags !== 0 /* Normal */ || func.parameters.length === 0)
|
|
74445
|
-
return void 0;
|
|
74446
|
-
let singleReturn;
|
|
74447
|
-
let singleReturnStatement;
|
|
74448
|
-
if (func.body && func.body.kind !== 241 /* Block */) {
|
|
74449
|
-
singleReturn = func.body;
|
|
74450
|
-
} else {
|
|
74451
|
-
if (functionHasImplicitReturn(func))
|
|
74452
|
-
return void 0;
|
|
74453
|
-
const bailedEarly = forEachReturnStatement(func.body, (returnStatement) => {
|
|
74454
|
-
if (singleReturn || !returnStatement.expression)
|
|
74455
|
-
return true;
|
|
74456
|
-
singleReturnStatement = returnStatement;
|
|
74457
|
-
singleReturn = returnStatement.expression;
|
|
74458
|
-
});
|
|
74459
|
-
if (bailedEarly || !singleReturn)
|
|
74460
|
-
return void 0;
|
|
74461
|
-
}
|
|
74462
|
-
const predicate = checkIfExpressionRefinesAnyParameter(singleReturn);
|
|
74463
|
-
if (predicate) {
|
|
74464
|
-
const [i, type] = predicate;
|
|
74465
|
-
const param = func.parameters[i];
|
|
74466
|
-
if (isIdentifier(param.name)) {
|
|
74467
|
-
return createTypePredicate(1 /* Identifier */, param.name.escapedText, i, type);
|
|
74468
|
-
}
|
|
74469
|
-
}
|
|
74470
|
-
return void 0;
|
|
74471
|
-
function checkIfExpressionRefinesAnyParameter(expr) {
|
|
74472
|
-
expr = skipParentheses(
|
|
74473
|
-
expr,
|
|
74474
|
-
/*excludeJSDocTypeAssertions*/
|
|
74475
|
-
true
|
|
74476
|
-
);
|
|
74477
|
-
const type = checkExpressionCached(expr);
|
|
74478
|
-
if (type !== booleanType)
|
|
74479
|
-
return void 0;
|
|
74480
|
-
return forEach(func.parameters, (param, i) => {
|
|
74481
|
-
const initType = getSymbolLinks(param.symbol).type;
|
|
74482
|
-
if (!initType || initType === booleanType || isSymbolAssigned(param.symbol)) {
|
|
74483
|
-
return;
|
|
74484
|
-
}
|
|
74485
|
-
const trueType2 = checkIfExpressionRefinesParameter(expr, param, initType);
|
|
74486
|
-
if (trueType2) {
|
|
74487
|
-
return [i, trueType2];
|
|
74488
|
-
}
|
|
74489
|
-
});
|
|
74490
|
-
}
|
|
74491
|
-
function checkIfExpressionRefinesParameter(expr, param, initType) {
|
|
74492
|
-
const antecedent = expr.flowNode ?? { flags: 2 /* Start */ };
|
|
74493
|
-
const trueCondition = {
|
|
74494
|
-
flags: 32 /* TrueCondition */,
|
|
74495
|
-
node: expr,
|
|
74496
|
-
antecedent
|
|
74497
|
-
};
|
|
74498
|
-
const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition);
|
|
74499
|
-
if (trueType2 === initType)
|
|
74500
|
-
return void 0;
|
|
74501
|
-
const falseCondition = {
|
|
74502
|
-
...trueCondition,
|
|
74503
|
-
flags: 64 /* FalseCondition */
|
|
74504
|
-
};
|
|
74505
|
-
const falseSubtype = getFlowTypeOfReference(param.name, trueType2, trueType2, func, falseCondition);
|
|
74506
|
-
if (!isTypeIdenticalTo(falseSubtype, neverType))
|
|
74507
|
-
return void 0;
|
|
74508
|
-
if (singleReturnStatement == null ? void 0 : singleReturnStatement.flowNode) {
|
|
74509
|
-
const typeAtReturn = getFlowTypeOfReference(param.name, initType, initType, func, singleReturnStatement == null ? void 0 : singleReturnStatement.flowNode);
|
|
74510
|
-
if (typeAtReturn !== initType) {
|
|
74511
|
-
return void 0;
|
|
74512
|
-
}
|
|
74513
|
-
}
|
|
74514
|
-
return trueType2;
|
|
74515
|
-
}
|
|
74516
|
-
}
|
|
74517
74428
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
|
|
74518
74429
|
addLazyDiagnostic(checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics);
|
|
74519
74430
|
return;
|
|
@@ -111146,8 +111057,8 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
111146
111057
|
removeComments: compilerOptions.removeComments,
|
|
111147
111058
|
newLine: compilerOptions.newLine,
|
|
111148
111059
|
noEmitHelpers: compilerOptions.noEmitHelpers,
|
|
111149
|
-
module: compilerOptions
|
|
111150
|
-
target: compilerOptions
|
|
111060
|
+
module: getEmitModuleKind(compilerOptions),
|
|
111061
|
+
target: getEmitScriptTarget(compilerOptions),
|
|
111151
111062
|
sourceMap: compilerOptions.sourceMap,
|
|
111152
111063
|
inlineSourceMap: compilerOptions.inlineSourceMap,
|
|
111153
111064
|
inlineSources: compilerOptions.inlineSources,
|