@@ -2278,7 +2278,7 @@ module.exports = __toCommonJS(typescript_exports);
22782278
22792279// src/compiler/corePublic.ts
22802280var versionMajorMinor = "5.7";
2281- var version = "5.7.2 ";
2281+ var version = "5.7.3 ";
22822282var Comparison = /* @__PURE__ */ ((Comparison3) => {
22832283 Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
22842284 Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -14547,6 +14547,7 @@ function sortAndDeduplicateDiagnostics(diagnostics) {
1454714547}
1454814548var targetToLibMap = /* @__PURE__ */ new Map([
1454914549 [99 /* ESNext */, "lib.esnext.full.d.ts"],
14550+ [11 /* ES2024 */, "lib.es2024.full.d.ts"],
1455014551 [10 /* ES2023 */, "lib.es2023.full.d.ts"],
1455114552 [9 /* ES2022 */, "lib.es2022.full.d.ts"],
1455214553 [8 /* ES2021 */, "lib.es2021.full.d.ts"],
@@ -14562,6 +14563,7 @@ function getDefaultLibFileName(options) {
1456214563 const target = getEmitScriptTarget(options);
1456314564 switch (target) {
1456414565 case 99 /* ESNext */:
14566+ case 11 /* ES2024 */:
1456514567 case 10 /* ES2023 */:
1456614568 case 9 /* ES2022 */:
1456714569 case 8 /* ES2021 */:
@@ -51379,6 +51381,12 @@ function createTypeChecker(host) {
5137951381 /*isReadonly*/
5138051382 true
5138151383 );
51384+ var anyBaseTypeIndexInfo = createIndexInfo(
51385+ stringType,
51386+ anyType,
51387+ /*isReadonly*/
51388+ false
51389+ );
5138251390 var iterationTypesCache = /* @__PURE__ */ new Map();
5138351391 var noIterationTypes = {
5138451392 get yieldType() {
@@ -61180,12 +61188,7 @@ function createTypeChecker(host) {
6118061188 addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));
6118161189 callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */));
6118261190 constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */));
61183- const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [createIndexInfo(
61184- stringType,
61185- anyType,
61186- /*isReadonly*/
61187- false
61188- )];
61191+ const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [anyBaseTypeIndexInfo];
6118961192 indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, (info) => !findIndexInfo(indexInfos, info.keyType)));
6119061193 }
6119161194 }
@@ -61711,12 +61714,7 @@ function createTypeChecker(host) {
6171161714 members = createSymbolTable(getNamedOrIndexSignatureMembers(members));
6171261715 addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
6171361716 } else if (baseConstructorType === anyType) {
61714- baseConstructorIndexInfo = createIndexInfo(
61715- stringType,
61716- anyType,
61717- /*isReadonly*/
61718- false
61719- );
61717+ baseConstructorIndexInfo = anyBaseTypeIndexInfo;
6172061718 }
6172161719 }
6172261720 const indexSymbol = getIndexSymbolFromSymbolTable(members);
@@ -75063,12 +75061,13 @@ function createTypeChecker(host) {
7506375061 const jsxFactoryRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found : void 0;
7506475062 const jsxFactoryNamespace = getJsxNamespace(node);
7506575063 const jsxFactoryLocation = isJsxOpeningLikeElement(node) ? node.tagName : node;
75064+ const shouldFactoryRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */;
7506675065 let jsxFactorySym;
7506775066 if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
7506875067 jsxFactorySym = resolveName(
7506975068 jsxFactoryLocation,
7507075069 jsxFactoryNamespace,
75071- compilerOptions.jsx === 1 /* Preserve */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
75070+ shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
7507275071 jsxFactoryRefErr,
7507375072 /*isUse*/
7507475073 true
@@ -75087,7 +75086,7 @@ function createTypeChecker(host) {
7508775086 resolveName(
7508875087 jsxFactoryLocation,
7508975088 localJsxNamespace,
75090- compilerOptions.jsx === 1 /* Preserve */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
75089+ shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
7509175090 jsxFactoryRefErr,
7509275091 /*isUse*/
7509375092 true
@@ -78648,6 +78647,13 @@ function createTypeChecker(host) {
7864878647 return getIntersectionType(x);
7864978648 }
7865078649 function reportNonexistentProperty(propNode, containingType, isUncheckedJS) {
78650+ const links = getNodeLinks(propNode);
78651+ const cache = links.nonExistentPropCheckCache || (links.nonExistentPropCheckCache = /* @__PURE__ */ new Set());
78652+ const key = `${getTypeId(containingType)}|${isUncheckedJS}`;
78653+ if (cache.has(key)) {
78654+ return;
78655+ }
78656+ cache.add(key);
7865178657 let errorInfo;
7865278658 let relatedInfo;
7865378659 if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 402784252 /* Primitive */)) {
@@ -80606,12 +80612,14 @@ function createTypeChecker(host) {
8060680612 const sourceFileLinks = getNodeLinks(getSourceFileOfNode(node));
8060780613 if (sourceFileLinks.jsxFragmentType !== void 0) return sourceFileLinks.jsxFragmentType;
8060880614 const jsxFragmentFactoryName = getJsxNamespace(node);
80609- if (jsxFragmentFactoryName === "null") return sourceFileLinks.jsxFragmentType = anyType;
80615+ const shouldResolveFactoryReference = (compilerOptions.jsx === 2 /* React */ || compilerOptions.jsxFragmentFactory !== void 0) && jsxFragmentFactoryName !== "null";
80616+ if (!shouldResolveFactoryReference) return sourceFileLinks.jsxFragmentType = anyType;
80617+ const shouldModuleRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */;
8061080618 const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : void 0;
8061180619 const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? resolveName(
8061280620 node,
8061380621 jsxFragmentFactoryName,
80614- compilerOptions.jsx === 1 /* Preserve */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
80622+ shouldModuleRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
8061580623 /*nameNotFoundMessage*/
8061680624 jsxFactoryRefErr,
8061780625 /*isUse*/
@@ -83177,7 +83185,9 @@ function createTypeChecker(host) {
8317783185 switch (node.kind) {
8317883186 case 223 /* AwaitExpression */:
8317983187 case 213 /* CallExpression */:
83188+ case 215 /* TaggedTemplateExpression */:
8318083189 case 212 /* ElementAccessExpression */:
83190+ case 236 /* MetaProperty */:
8318183191 case 214 /* NewExpression */:
8318283192 case 211 /* PropertyAccessExpression */:
8318383193 case 229 /* YieldExpression */:
@@ -83193,6 +83203,8 @@ function createTypeChecker(host) {
8319383203 case 56 /* AmpersandAmpersandToken */:
8319483204 case 77 /* AmpersandAmpersandEqualsToken */:
8319583205 return 3 /* Sometimes */;
83206+ case 28 /* CommaToken */:
83207+ return getSyntacticNullishnessSemantics(node.right);
8319683208 }
8319783209 return 2 /* Never */;
8319883210 case 227 /* ConditionalExpression */:
@@ -89305,7 +89317,7 @@ function createTypeChecker(host) {
8930589317 }
8930689318 }
8930789319 }
89308- if (isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
89320+ if (!importClause.isTypeOnly && moduleKind === 199 /* NodeNext */ && isOnlyImportableAsDefault(node.moduleSpecifier, resolvedModule) && !hasTypeJsonImportAttribute(node)) {
8930989321 error2(node.moduleSpecifier, Diagnostics.Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0, ModuleKind[moduleKind]);
8931089322 }
8931189323 } else if (noUncheckedSideEffectImports && !importClause) {
@@ -91589,6 +91601,7 @@ function createTypeChecker(host) {
9158991601 result || (result = []);
9159091602 for (const info of infoList) {
9159191603 if (info.declaration) continue;
91604+ if (info === anyBaseTypeIndexInfo) continue;
9159291605 const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
9159391606 if (node && infoList === staticInfos) {
9159491607 (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
@@ -136663,9 +136676,9 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
136663136676 }
136664136677 if (!result && node.kind === 303 /* PropertyAssignment */) {
136665136678 const initializer = node.initializer;
136666- const type = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 234 /* AsExpression */ || initializer.kind === 216 /* TypeAssertionExpression */ ? initializer.type : void 0;
136667- if (type && !isConstTypeReference(type )) {
136668- result = serializeExistingTypeNode(type , context);
136679+ const assertionNode = isJSDocTypeAssertion(initializer) ? getJSDocTypeAssertionType(initializer) : initializer.kind === 234 /* AsExpression */ || initializer.kind === 216 /* TypeAssertionExpression */ ? initializer.type : void 0;
136680+ if (assertionNode && !isConstTypeReference(assertionNode) && resolver.canReuseTypeNodeAnnotation(context, node, assertionNode, symbol )) {
136681+ result = serializeExistingTypeNode(assertionNode , context);
136669136682 }
136670136683 }
136671136684 return result ?? inferTypeOfDeclaration(
0 commit comments