mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-20 21:22:28 -05:00
Bump version to 5.4.3 and LKG
This commit is contained in:
83
lib/tsc.js
83
lib/tsc.js
@@ -18,7 +18,7 @@ and limitations under the License.
|
||||
|
||||
// src/compiler/corePublic.ts
|
||||
var versionMajorMinor = "5.4";
|
||||
var version = "5.4.2";
|
||||
var version = "5.4.3";
|
||||
|
||||
// src/compiler/core.ts
|
||||
var emptyArray = [];
|
||||
@@ -57966,7 +57966,7 @@ function createTypeChecker(host) {
|
||||
const typeVarIndex = typeSet[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
||||
const typeVariable = typeSet[typeVarIndex];
|
||||
const primitiveType = typeSet[1 - typeVarIndex];
|
||||
if (typeVariable.flags & 8650752 /* TypeVariable */ && (primitiveType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) || includes & 16777216 /* IncludesEmptyObject */)) {
|
||||
if (typeVariable.flags & 8650752 /* TypeVariable */ && (primitiveType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) && !isGenericStringLikeType(primitiveType) || includes & 16777216 /* IncludesEmptyObject */)) {
|
||||
const constraint = getBaseConstraintOfType(typeVariable);
|
||||
if (constraint && everyType(constraint, (t) => !!(t.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */)) || isEmptyAnonymousObjectType(t))) {
|
||||
if (isTypeStrictSubtypeOf(constraint, primitiveType)) {
|
||||
@@ -58574,6 +58574,9 @@ function createTypeChecker(host) {
|
||||
function isPatternLiteralType(type) {
|
||||
return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && isPatternLiteralPlaceholderType(type.type);
|
||||
}
|
||||
function isGenericStringLikeType(type) {
|
||||
return !!(type.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type);
|
||||
}
|
||||
function isGenericType(type) {
|
||||
return !!getGenericObjectFlags(type);
|
||||
}
|
||||
@@ -58596,7 +58599,7 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return type.objectFlags & 12582912 /* IsGenericType */;
|
||||
}
|
||||
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
||||
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */) || isGenericStringLikeType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
||||
}
|
||||
function getSimplifiedType(type, writing) {
|
||||
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
||||
@@ -65644,7 +65647,7 @@ function createTypeChecker(host) {
|
||||
function hasMatchingArgument(expression, reference) {
|
||||
if (expression.arguments) {
|
||||
for (const argument of expression.arguments) {
|
||||
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference) || getCandidateDiscriminantPropertyAccess(argument, reference)) {
|
||||
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -65654,36 +65657,6 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getCandidateDiscriminantPropertyAccess(expr, reference) {
|
||||
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
||||
if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
} else if (isAccessExpression(expr)) {
|
||||
if (isMatchingReference(reference, expr.expression)) {
|
||||
return expr;
|
||||
}
|
||||
} else if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
if (isConstantVariable(symbol)) {
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
|
||||
return declaration.initializer;
|
||||
}
|
||||
if (isBindingElement(declaration) && !declaration.initializer) {
|
||||
const parent = declaration.parent.parent;
|
||||
if (isVariableDeclaration(parent) && !parent.type && parent.initializer && (isIdentifier(parent.initializer) || isAccessExpression(parent.initializer)) && isMatchingReference(reference, parent.initializer)) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
function getFlowNodeId(flow) {
|
||||
if (!flow.id || flow.id < 0) {
|
||||
flow.id = nextFlowId;
|
||||
@@ -66783,9 +66756,39 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function getCandidateDiscriminantPropertyAccess(expr) {
|
||||
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
||||
if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
} else if (isAccessExpression(expr)) {
|
||||
if (isMatchingReference(reference, expr.expression)) {
|
||||
return expr;
|
||||
}
|
||||
} else if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
if (isConstantVariable(symbol)) {
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
|
||||
return declaration.initializer;
|
||||
}
|
||||
if (isBindingElement(declaration) && !declaration.initializer) {
|
||||
const parent = declaration.parent.parent;
|
||||
if (isVariableDeclaration(parent) && !parent.type && parent.initializer && (isIdentifier(parent.initializer) || isAccessExpression(parent.initializer)) && isMatchingReference(reference, parent.initializer)) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
function getDiscriminantPropertyAccess(expr, computedType) {
|
||||
if (declaredType.flags & 1048576 /* Union */ || computedType.flags & 1048576 /* Union */) {
|
||||
const access = getCandidateDiscriminantPropertyAccess(expr, reference);
|
||||
const access = getCandidateDiscriminantPropertyAccess(expr);
|
||||
if (access) {
|
||||
const name = getAccessedPropertyName(access);
|
||||
if (name) {
|
||||
@@ -72506,7 +72509,7 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return resolveErrorCall(node);
|
||||
}
|
||||
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunctionOrConstructor)) {
|
||||
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
|
||||
skippedGenericFunction(node, checkMode);
|
||||
return resolvingSignature;
|
||||
}
|
||||
@@ -72516,12 +72519,8 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
|
||||
}
|
||||
function isGenericFunctionReturningFunctionOrConstructor(signature) {
|
||||
if (!signature.typeParameters) {
|
||||
return false;
|
||||
}
|
||||
const returnType = getReturnTypeOfSignature(signature);
|
||||
return isFunctionType(returnType) || isConstructorType(returnType);
|
||||
function isGenericFunctionReturningFunction(signature) {
|
||||
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
|
||||
}
|
||||
function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
|
||||
return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & 1048576 /* Union */) && !(getReducedType(apparentFuncType).flags & 131072 /* Never */) && isTypeAssignableTo(funcType, globalFunctionType);
|
||||
|
||||
@@ -2340,7 +2340,7 @@ module.exports = __toCommonJS(server_exports);
|
||||
|
||||
// src/compiler/corePublic.ts
|
||||
var versionMajorMinor = "5.4";
|
||||
var version = "5.4.2";
|
||||
var version = "5.4.3";
|
||||
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
||||
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
||||
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
||||
@@ -62710,7 +62710,7 @@ function createTypeChecker(host) {
|
||||
const typeVarIndex = typeSet[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
||||
const typeVariable = typeSet[typeVarIndex];
|
||||
const primitiveType = typeSet[1 - typeVarIndex];
|
||||
if (typeVariable.flags & 8650752 /* TypeVariable */ && (primitiveType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) || includes & 16777216 /* IncludesEmptyObject */)) {
|
||||
if (typeVariable.flags & 8650752 /* TypeVariable */ && (primitiveType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) && !isGenericStringLikeType(primitiveType) || includes & 16777216 /* IncludesEmptyObject */)) {
|
||||
const constraint = getBaseConstraintOfType(typeVariable);
|
||||
if (constraint && everyType(constraint, (t) => !!(t.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */)) || isEmptyAnonymousObjectType(t))) {
|
||||
if (isTypeStrictSubtypeOf(constraint, primitiveType)) {
|
||||
@@ -63318,6 +63318,9 @@ function createTypeChecker(host) {
|
||||
function isPatternLiteralType(type) {
|
||||
return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && isPatternLiteralPlaceholderType(type.type);
|
||||
}
|
||||
function isGenericStringLikeType(type) {
|
||||
return !!(type.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type);
|
||||
}
|
||||
function isGenericType(type) {
|
||||
return !!getGenericObjectFlags(type);
|
||||
}
|
||||
@@ -63340,7 +63343,7 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return type.objectFlags & 12582912 /* IsGenericType */;
|
||||
}
|
||||
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
||||
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */) || isGenericStringLikeType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
||||
}
|
||||
function getSimplifiedType(type, writing) {
|
||||
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
||||
@@ -70388,7 +70391,7 @@ function createTypeChecker(host) {
|
||||
function hasMatchingArgument(expression, reference) {
|
||||
if (expression.arguments) {
|
||||
for (const argument of expression.arguments) {
|
||||
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference) || getCandidateDiscriminantPropertyAccess(argument, reference)) {
|
||||
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -70398,36 +70401,6 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getCandidateDiscriminantPropertyAccess(expr, reference) {
|
||||
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
||||
if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
} else if (isAccessExpression(expr)) {
|
||||
if (isMatchingReference(reference, expr.expression)) {
|
||||
return expr;
|
||||
}
|
||||
} else if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
if (isConstantVariable(symbol)) {
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
|
||||
return declaration.initializer;
|
||||
}
|
||||
if (isBindingElement(declaration) && !declaration.initializer) {
|
||||
const parent2 = declaration.parent.parent;
|
||||
if (isVariableDeclaration(parent2) && !parent2.type && parent2.initializer && (isIdentifier(parent2.initializer) || isAccessExpression(parent2.initializer)) && isMatchingReference(reference, parent2.initializer)) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
function getFlowNodeId(flow) {
|
||||
if (!flow.id || flow.id < 0) {
|
||||
flow.id = nextFlowId;
|
||||
@@ -71527,9 +71500,39 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function getCandidateDiscriminantPropertyAccess(expr) {
|
||||
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
||||
if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
} else if (isAccessExpression(expr)) {
|
||||
if (isMatchingReference(reference, expr.expression)) {
|
||||
return expr;
|
||||
}
|
||||
} else if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
if (isConstantVariable(symbol)) {
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
|
||||
return declaration.initializer;
|
||||
}
|
||||
if (isBindingElement(declaration) && !declaration.initializer) {
|
||||
const parent2 = declaration.parent.parent;
|
||||
if (isVariableDeclaration(parent2) && !parent2.type && parent2.initializer && (isIdentifier(parent2.initializer) || isAccessExpression(parent2.initializer)) && isMatchingReference(reference, parent2.initializer)) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
function getDiscriminantPropertyAccess(expr, computedType) {
|
||||
if (declaredType.flags & 1048576 /* Union */ || computedType.flags & 1048576 /* Union */) {
|
||||
const access = getCandidateDiscriminantPropertyAccess(expr, reference);
|
||||
const access = getCandidateDiscriminantPropertyAccess(expr);
|
||||
if (access) {
|
||||
const name = getAccessedPropertyName(access);
|
||||
if (name) {
|
||||
@@ -77250,7 +77253,7 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return resolveErrorCall(node);
|
||||
}
|
||||
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunctionOrConstructor)) {
|
||||
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
|
||||
skippedGenericFunction(node, checkMode);
|
||||
return resolvingSignature;
|
||||
}
|
||||
@@ -77260,12 +77263,8 @@ function createTypeChecker(host) {
|
||||
}
|
||||
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
|
||||
}
|
||||
function isGenericFunctionReturningFunctionOrConstructor(signature) {
|
||||
if (!signature.typeParameters) {
|
||||
return false;
|
||||
}
|
||||
const returnType = getReturnTypeOfSignature(signature);
|
||||
return isFunctionType(returnType) || isConstructorType(returnType);
|
||||
function isGenericFunctionReturningFunction(signature) {
|
||||
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
|
||||
}
|
||||
function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
|
||||
return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & 1048576 /* Union */) && !(getReducedType(apparentFuncType).flags & 131072 /* Never */) && isTypeAssignableTo(funcType, globalFunctionType);
|
||||
|
||||
@@ -35,7 +35,7 @@ var ts = (() => {
|
||||
"src/compiler/corePublic.ts"() {
|
||||
"use strict";
|
||||
versionMajorMinor = "5.4";
|
||||
version = "5.4.2";
|
||||
version = "5.4.3";
|
||||
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
||||
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
||||
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
||||
@@ -60465,7 +60465,7 @@ ${lanes.join("\n")}
|
||||
const typeVarIndex = typeSet[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
||||
const typeVariable = typeSet[typeVarIndex];
|
||||
const primitiveType = typeSet[1 - typeVarIndex];
|
||||
if (typeVariable.flags & 8650752 /* TypeVariable */ && (primitiveType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) || includes & 16777216 /* IncludesEmptyObject */)) {
|
||||
if (typeVariable.flags & 8650752 /* TypeVariable */ && (primitiveType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) && !isGenericStringLikeType(primitiveType) || includes & 16777216 /* IncludesEmptyObject */)) {
|
||||
const constraint = getBaseConstraintOfType(typeVariable);
|
||||
if (constraint && everyType(constraint, (t) => !!(t.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */)) || isEmptyAnonymousObjectType(t))) {
|
||||
if (isTypeStrictSubtypeOf(constraint, primitiveType)) {
|
||||
@@ -61073,6 +61073,9 @@ ${lanes.join("\n")}
|
||||
function isPatternLiteralType(type) {
|
||||
return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && isPatternLiteralPlaceholderType(type.type);
|
||||
}
|
||||
function isGenericStringLikeType(type) {
|
||||
return !!(type.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type);
|
||||
}
|
||||
function isGenericType(type) {
|
||||
return !!getGenericObjectFlags(type);
|
||||
}
|
||||
@@ -61095,7 +61098,7 @@ ${lanes.join("\n")}
|
||||
}
|
||||
return type.objectFlags & 12582912 /* IsGenericType */;
|
||||
}
|
||||
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
||||
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */) || isGenericStringLikeType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
||||
}
|
||||
function getSimplifiedType(type, writing) {
|
||||
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
||||
@@ -68143,7 +68146,7 @@ ${lanes.join("\n")}
|
||||
function hasMatchingArgument(expression, reference) {
|
||||
if (expression.arguments) {
|
||||
for (const argument of expression.arguments) {
|
||||
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference) || getCandidateDiscriminantPropertyAccess(argument, reference)) {
|
||||
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -68153,36 +68156,6 @@ ${lanes.join("\n")}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getCandidateDiscriminantPropertyAccess(expr, reference) {
|
||||
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
||||
if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
} else if (isAccessExpression(expr)) {
|
||||
if (isMatchingReference(reference, expr.expression)) {
|
||||
return expr;
|
||||
}
|
||||
} else if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
if (isConstantVariable(symbol)) {
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
|
||||
return declaration.initializer;
|
||||
}
|
||||
if (isBindingElement(declaration) && !declaration.initializer) {
|
||||
const parent2 = declaration.parent.parent;
|
||||
if (isVariableDeclaration(parent2) && !parent2.type && parent2.initializer && (isIdentifier(parent2.initializer) || isAccessExpression(parent2.initializer)) && isMatchingReference(reference, parent2.initializer)) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
function getFlowNodeId(flow) {
|
||||
if (!flow.id || flow.id < 0) {
|
||||
flow.id = nextFlowId;
|
||||
@@ -69282,9 +69255,39 @@ ${lanes.join("\n")}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function getCandidateDiscriminantPropertyAccess(expr) {
|
||||
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
||||
if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
} else if (isAccessExpression(expr)) {
|
||||
if (isMatchingReference(reference, expr.expression)) {
|
||||
return expr;
|
||||
}
|
||||
} else if (isIdentifier(expr)) {
|
||||
const symbol = getResolvedSymbol(expr);
|
||||
if (isConstantVariable(symbol)) {
|
||||
const declaration = symbol.valueDeclaration;
|
||||
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
|
||||
return declaration.initializer;
|
||||
}
|
||||
if (isBindingElement(declaration) && !declaration.initializer) {
|
||||
const parent2 = declaration.parent.parent;
|
||||
if (isVariableDeclaration(parent2) && !parent2.type && parent2.initializer && (isIdentifier(parent2.initializer) || isAccessExpression(parent2.initializer)) && isMatchingReference(reference, parent2.initializer)) {
|
||||
return declaration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return void 0;
|
||||
}
|
||||
function getDiscriminantPropertyAccess(expr, computedType) {
|
||||
if (declaredType.flags & 1048576 /* Union */ || computedType.flags & 1048576 /* Union */) {
|
||||
const access = getCandidateDiscriminantPropertyAccess(expr, reference);
|
||||
const access = getCandidateDiscriminantPropertyAccess(expr);
|
||||
if (access) {
|
||||
const name = getAccessedPropertyName(access);
|
||||
if (name) {
|
||||
@@ -75005,7 +75008,7 @@ ${lanes.join("\n")}
|
||||
}
|
||||
return resolveErrorCall(node);
|
||||
}
|
||||
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunctionOrConstructor)) {
|
||||
if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
|
||||
skippedGenericFunction(node, checkMode);
|
||||
return resolvingSignature;
|
||||
}
|
||||
@@ -75015,12 +75018,8 @@ ${lanes.join("\n")}
|
||||
}
|
||||
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
|
||||
}
|
||||
function isGenericFunctionReturningFunctionOrConstructor(signature) {
|
||||
if (!signature.typeParameters) {
|
||||
return false;
|
||||
}
|
||||
const returnType = getReturnTypeOfSignature(signature);
|
||||
return isFunctionType(returnType) || isConstructorType(returnType);
|
||||
function isGenericFunctionReturningFunction(signature) {
|
||||
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
|
||||
}
|
||||
function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
|
||||
return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & 1048576 /* Union */) && !(getReducedType(apparentFuncType).flags & 131072 /* Never */) && isTypeAssignableTo(funcType, globalFunctionType);
|
||||
|
||||
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
||||
|
||||
// src/compiler/corePublic.ts
|
||||
var versionMajorMinor = "5.4";
|
||||
var version = "5.4.2";
|
||||
var version = "5.4.3";
|
||||
|
||||
// src/compiler/core.ts
|
||||
var emptyArray = [];
|
||||
|
||||
Reference in New Issue
Block a user