Skip to content

Commit

Permalink
Bump version to 5.3.3 and LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
typescript-bot committed Dec 2, 2023
1 parent 4c2afa7 commit 63717cf
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 86 deletions.
48 changes: 23 additions & 25 deletions lib/tsc.js
Expand Up @@ -18,7 +18,7 @@ and limitations under the License.

// src/compiler/corePublic.ts
var versionMajorMinor = "5.3";
var version = "5.3.2";
var version = "5.3.3";

// src/compiler/core.ts
var emptyArray = [];
Expand Down Expand Up @@ -3678,7 +3678,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 138117121] = "ObjectFlagsType";
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
Expand Down Expand Up @@ -15971,7 +15971,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
}
function getObjectFlags(type) {
return type.flags & 138117121 /* ObjectFlagsType */ ? type.objectFlags : 0;
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
}
function isUMDExportSymbol(symbol) {
return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]);
Expand Down Expand Up @@ -56944,7 +56944,7 @@ function createTypeChecker(host) {
}
}
function removeStringLiteralsMatchedByTemplateLiterals(types) {
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types)));
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
if (templates.length) {
let i = types.length;
while (i > 0) {
Expand Down Expand Up @@ -57344,19 +57344,14 @@ function createTypeChecker(host) {
function getConstituentCountOfTypes(types) {
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
}
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
if (types.length !== 2) {
return false;
}
const [t1, t2] = types;
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
}
function getTypeFromIntersectionTypeNode(node) {
const links = getNodeLinks(node);
if (!links.resolvedType) {
const aliasSymbol = getAliasSymbolForTypeNode(node);
const types = map(node.types, getTypeFromTypeNode);
const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
}
return links.resolvedType;
Expand Down Expand Up @@ -57568,11 +57563,6 @@ function createTypeChecker(host) {
}
function createTemplateLiteralType(texts, types) {
const type = createType(134217728 /* TemplateLiteral */);
type.objectFlags = getPropagatingFlagsOfTypes(
types,
/*excludeKinds*/
98304 /* Nullable */
);
type.texts = texts;
type.types = types;
return type;
Expand Down Expand Up @@ -57867,7 +57857,15 @@ function createTypeChecker(host) {
}
function isPatternLiteralPlaceholderType(type) {
if (type.flags & 2097152 /* Intersection */) {
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
let seenPlaceholder = false;
for (const t of type.types) {
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
seenPlaceholder = true;
} else if (!(t.flags & 524288 /* Object */)) {
return false;
}
}
return seenPlaceholder;
}
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
}
Expand All @@ -57884,7 +57882,7 @@ function createTypeChecker(host) {
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
}
function getGenericObjectFlags(type) {
if (type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */)) {
if (type.flags & 3145728 /* UnionOrIntersection */) {
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
}
Expand All @@ -57896,7 +57894,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 */ | 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 */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
}
function getSimplifiedType(type, writing) {
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
Expand Down Expand Up @@ -58922,7 +58920,7 @@ function createTypeChecker(host) {
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
target.instantiations.set(id, result);
const resultObjectFlags = getObjectFlags(result);
if (result.flags & 138117121 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
Expand Down Expand Up @@ -63636,8 +63634,8 @@ function createTypeChecker(host) {
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
}
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
if (type.flags & 138117121 /* ObjectFlagsType */) {
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
if (type.flags & 3899393 /* ObjectFlagsType */) {
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
}
return result;
Expand Down Expand Up @@ -66155,10 +66153,10 @@ function createTypeChecker(host) {
if (isMatchingConstructorReference(right)) {
return narrowTypeByConstructor(type, operator, left, assumeTrue);
}
if (isBooleanLiteral(right)) {
if (isBooleanLiteral(right) && !isAccessExpression(left)) {
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
}
if (isBooleanLiteral(left)) {
if (isBooleanLiteral(left) && !isAccessExpression(right)) {
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
}
break;
Expand Down

0 comments on commit 63717cf

Please sign in to comment.