@typescript-deploys/pr-build 5.8.0-pr-60576-12 → 5.8.0-pr-60718-25

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 CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.8";
21
- var version = `${versionMajorMinor}.0-insiders.20241204`;
21
+ var version = `${versionMajorMinor}.0-insiders.20241211`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6850,6 +6850,8 @@ var Diagnostics = {
6850
6850
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
6851
6851
  Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
6852
6852
  One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1 /* Error */, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
6853
+ This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic: diag(4127, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127", "This member cannot have an 'override' modifier because its name is dynamic."),
6854
+ This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic: diag(4128, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128", "This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."),
6853
6855
  The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
6854
6856
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
6855
6857
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -40736,9 +40738,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) {
40736
40738
  }
40737
40739
  function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson = true) {
40738
40740
  const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
40739
- const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
40740
- const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
40741
- return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
40741
+ return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo), state);
40742
40742
  }
40743
40743
  function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options) {
40744
40744
  return {
@@ -40845,13 +40845,14 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
40845
40845
  (_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath);
40846
40846
  }
40847
40847
  }
40848
- function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
40848
+ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJson) {
40849
+ const versionPaths = packageJson && getVersionPathsOfPackageJsonInfo(packageJson, state);
40849
40850
  let packageFile;
40850
- if (jsonContent) {
40851
+ if (packageJson && arePathsEqual(packageJson == null ? void 0 : packageJson.packageDirectory, candidate, state.host)) {
40851
40852
  if (state.isConfigLookup) {
40852
- packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
40853
+ packageFile = readPackageJsonTSConfigField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state);
40853
40854
  } else {
40854
- packageFile = extensions & 4 /* Declaration */ && readPackageJsonTypesFields(jsonContent, candidate, state) || extensions & (3 /* ImplementationFiles */ | 4 /* Declaration */) && readPackageJsonMainField(jsonContent, candidate, state) || void 0;
40855
+ packageFile = extensions & 4 /* Declaration */ && readPackageJsonTypesFields(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || extensions & (3 /* ImplementationFiles */ | 4 /* Declaration */) && readPackageJsonMainField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || void 0;
40855
40856
  }
40856
40857
  }
40857
40858
  const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
@@ -40870,7 +40871,7 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
40870
40871
  const features = state2.features;
40871
40872
  const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
40872
40873
  state2.candidateIsFromPackageJsonField = true;
40873
- if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
40874
+ if ((packageJson == null ? void 0 : packageJson.contents.packageJsonContent.type) !== "module") {
40874
40875
  state2.features &= ~32 /* EsmMode */;
40875
40876
  }
40876
40877
  const result = nodeLoadModuleByRelativeName(
@@ -41473,8 +41474,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
41473
41474
  candidate,
41474
41475
  !nodeModulesDirectoryExists,
41475
41476
  state,
41476
- packageInfo.contents.packageJsonContent,
41477
- getVersionPathsOfPackageJsonInfo(packageInfo, state)
41477
+ packageInfo
41478
41478
  );
41479
41479
  return withPackageId(packageInfo, fromDirectory, state);
41480
41480
  }
@@ -41484,8 +41484,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
41484
41484
  candidate2,
41485
41485
  onlyRecordFailures,
41486
41486
  state2,
41487
- packageInfo && packageInfo.contents.packageJsonContent,
41488
- packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state2)
41487
+ packageInfo
41489
41488
  );
41490
41489
  if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
41491
41490
  pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
@@ -46800,6 +46799,12 @@ function createTypeChecker(host) {
46800
46799
  /*isReadonly*/
46801
46800
  true
46802
46801
  );
46802
+ var anyBaseTypeIndexInfo = createIndexInfo(
46803
+ stringType,
46804
+ anyType,
46805
+ /*isReadonly*/
46806
+ false
46807
+ );
46803
46808
  var iterationTypesCache = /* @__PURE__ */ new Map();
46804
46809
  var noIterationTypes = {
46805
46810
  get yieldType() {
@@ -56742,12 +56747,7 @@ function createTypeChecker(host) {
56742
56747
  addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));
56743
56748
  callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */));
56744
56749
  constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */));
56745
- const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [createIndexInfo(
56746
- stringType,
56747
- anyType,
56748
- /*isReadonly*/
56749
- false
56750
- )];
56750
+ const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [anyBaseTypeIndexInfo];
56751
56751
  indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, (info) => !findIndexInfo(indexInfos, info.keyType)));
56752
56752
  }
56753
56753
  }
@@ -57273,12 +57273,7 @@ function createTypeChecker(host) {
57273
57273
  members = createSymbolTable(getNamedOrIndexSignatureMembers(members));
57274
57274
  addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
57275
57275
  } else if (baseConstructorType === anyType) {
57276
- baseConstructorIndexInfo = createIndexInfo(
57277
- stringType,
57278
- anyType,
57279
- /*isReadonly*/
57280
- false
57281
- );
57276
+ baseConstructorIndexInfo = anyBaseTypeIndexInfo;
57282
57277
  }
57283
57278
  }
57284
57279
  const indexSymbol = getIndexSymbolFromSymbolTable(members);
@@ -68439,14 +68434,20 @@ function createTypeChecker(host) {
68439
68434
  }
68440
68435
  return false;
68441
68436
  }
68442
- function isDiscriminantProperty(type, name) {
68437
+ function isDiscriminantProperty(type, name, considerNonUniformPrimitivePropDiscriminant = true) {
68438
+ var _a;
68443
68439
  if (type && type.flags & 1048576 /* Union */) {
68444
68440
  const prop = getUnionOrIntersectionProperty(type, name);
68445
68441
  if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) {
68446
- if (prop.links.isDiscriminantProperty === void 0) {
68447
- prop.links.isDiscriminantProperty = (prop.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop));
68442
+ const propType = getTypeOfSymbol(prop);
68443
+ const transientSymbol = prop;
68444
+ (_a = transientSymbol.links).isDiscriminantProperty ?? (_a.isDiscriminantProperty = /* @__PURE__ */ new Map());
68445
+ let isDiscriminant = transientSymbol.links.isDiscriminantProperty.get(considerNonUniformPrimitivePropDiscriminant);
68446
+ if (typeof isDiscriminant === "undefined") {
68447
+ isDiscriminant = ((transientSymbol.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ || !!(considerNonUniformPrimitivePropDiscriminant && transientSymbol.links.checkFlags & 64 /* HasNonUniformType */ && someType(propType, (t) => !!(t.flags & 402784252 /* Primitive */)))) && !isGenericType(propType);
68448
+ transientSymbol.links.isDiscriminantProperty.set(considerNonUniformPrimitivePropDiscriminant, isDiscriminant);
68448
68449
  }
68449
- return !!prop.links.isDiscriminantProperty;
68450
+ return isDiscriminant;
68450
68451
  }
68451
68452
  }
68452
68453
  return false;
@@ -68454,7 +68455,12 @@ function createTypeChecker(host) {
68454
68455
  function findDiscriminantProperties(sourceProperties, target) {
68455
68456
  let result;
68456
68457
  for (const sourceProperty of sourceProperties) {
68457
- if (isDiscriminantProperty(target, sourceProperty.escapedName)) {
68458
+ if (isDiscriminantProperty(
68459
+ target,
68460
+ sourceProperty.escapedName,
68461
+ /*considerNonUniformPrimitivePropDiscriminant*/
68462
+ false
68463
+ )) {
68458
68464
  if (result) {
68459
68465
  result.push(sourceProperty);
68460
68466
  continue;
@@ -70677,12 +70683,13 @@ function createTypeChecker(host) {
70677
70683
  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;
70678
70684
  const jsxFactoryNamespace = getJsxNamespace(node);
70679
70685
  const jsxFactoryLocation = isJsxOpeningLikeElement(node) ? node.tagName : node;
70686
+ const shouldFactoryRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */;
70680
70687
  let jsxFactorySym;
70681
70688
  if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
70682
70689
  jsxFactorySym = resolveName(
70683
70690
  jsxFactoryLocation,
70684
70691
  jsxFactoryNamespace,
70685
- compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
70692
+ shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
70686
70693
  jsxFactoryRefErr,
70687
70694
  /*isUse*/
70688
70695
  true
@@ -70696,12 +70703,13 @@ function createTypeChecker(host) {
70696
70703
  }
70697
70704
  if (isJsxOpeningFragment(node)) {
70698
70705
  const file = getSourceFileOfNode(node);
70699
- const localJsxNamespace = getLocalJsxNamespace(file);
70700
- if (localJsxNamespace) {
70706
+ const entity = getJsxFactoryEntity(file);
70707
+ if (entity) {
70708
+ const localJsxNamespace = getFirstIdentifier(entity).escapedText;
70701
70709
  resolveName(
70702
70710
  jsxFactoryLocation,
70703
70711
  localJsxNamespace,
70704
- compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
70712
+ shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
70705
70713
  jsxFactoryRefErr,
70706
70714
  /*isUse*/
70707
70715
  true
@@ -74276,6 +74284,13 @@ function createTypeChecker(host) {
74276
74284
  return getIntersectionType(x);
74277
74285
  }
74278
74286
  function reportNonexistentProperty(propNode, containingType, isUncheckedJS) {
74287
+ const links = getNodeLinks(propNode);
74288
+ const cache = links.nonExistentPropCheckCache || (links.nonExistentPropCheckCache = /* @__PURE__ */ new Set());
74289
+ const key = `${getTypeId(containingType)}|${isUncheckedJS}`;
74290
+ if (cache.has(key)) {
74291
+ return;
74292
+ }
74293
+ cache.add(key);
74279
74294
  let errorInfo;
74280
74295
  let relatedInfo;
74281
74296
  if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 402784252 /* Primitive */)) {
@@ -76239,12 +76254,14 @@ function createTypeChecker(host) {
76239
76254
  const sourceFileLinks = getNodeLinks(getSourceFileOfNode(node));
76240
76255
  if (sourceFileLinks.jsxFragmentType !== void 0) return sourceFileLinks.jsxFragmentType;
76241
76256
  const jsxFragmentFactoryName = getJsxNamespace(node);
76242
- if (jsxFragmentFactoryName === "null") return sourceFileLinks.jsxFragmentType = anyType;
76257
+ const shouldResolveFactoryReference = (compilerOptions.jsx === 2 /* React */ || compilerOptions.jsxFragmentFactory !== void 0) && jsxFragmentFactoryName !== "null";
76258
+ if (!shouldResolveFactoryReference) return sourceFileLinks.jsxFragmentType = anyType;
76259
+ const shouldModuleRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */;
76243
76260
  const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : void 0;
76244
76261
  const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? resolveName(
76245
76262
  node,
76246
76263
  jsxFragmentFactoryName,
76247
- compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
76264
+ shouldModuleRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
76248
76265
  /*nameNotFoundMessage*/
76249
76266
  jsxFactoryRefErr,
76250
76267
  /*isUse*/
@@ -84099,6 +84116,13 @@ function createTypeChecker(host) {
84099
84116
  function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, member, errorNode) {
84100
84117
  const isJs = isInJSFile(node);
84101
84118
  const nodeInAmbientContext = !!(node.flags & 33554432 /* Ambient */);
84119
+ if (memberHasOverrideModifier && (member == null ? void 0 : member.valueDeclaration) && isClassElement(member.valueDeclaration) && member.valueDeclaration.name && isNonBindableDynamicName(member.valueDeclaration.name)) {
84120
+ error(
84121
+ errorNode,
84122
+ isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic : Diagnostics.This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic
84123
+ );
84124
+ return 2 /* HasInvalidOverride */;
84125
+ }
84102
84126
  if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
84103
84127
  const thisType = memberIsStatic ? staticType : typeWithThis;
84104
84128
  const baseType = memberIsStatic ? baseStaticType : baseWithThis;
@@ -87433,6 +87457,7 @@ function createTypeChecker(host) {
87433
87457
  result || (result = []);
87434
87458
  for (const info of infoList) {
87435
87459
  if (info.declaration) continue;
87460
+ if (info === anyBaseTypeIndexInfo) continue;
87436
87461
  const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
87437
87462
  if (node && infoList === staticInfos) {
87438
87463
  (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
@@ -4989,7 +4989,7 @@ declare namespace ts {
4989
4989
  readonly modifiers?: NodeArray<Modifier>;
4990
4990
  readonly equalsGreaterThanToken: EqualsGreaterThanToken;
4991
4991
  readonly body: ConciseBody;
4992
- readonly name: never;
4992
+ readonly name?: never;
4993
4993
  }
4994
4994
  interface LiteralLikeNode extends Node {
4995
4995
  text: string;
package/lib/typescript.js CHANGED
@@ -2278,7 +2278,7 @@ module.exports = __toCommonJS(typescript_exports);
2278
2278
 
2279
2279
  // src/compiler/corePublic.ts
2280
2280
  var versionMajorMinor = "5.8";
2281
- var version = `${versionMajorMinor}.0-insiders.20241204`;
2281
+ var version = `${versionMajorMinor}.0-insiders.20241211`;
2282
2282
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2283
2283
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2284
2284
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10229,6 +10229,8 @@ var Diagnostics = {
10229
10229
  Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
10230
10230
  Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
10231
10231
  One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1 /* Error */, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
10232
+ This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic: diag(4127, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127", "This member cannot have an 'override' modifier because its name is dynamic."),
10233
+ This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic: diag(4128, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128", "This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."),
10232
10234
  The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
10233
10235
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
10234
10236
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -45107,9 +45109,7 @@ function tryFileLookup(fileName, onlyRecordFailures, state) {
45107
45109
  }
45108
45110
  function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson = true) {
45109
45111
  const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
45110
- const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
45111
- const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
45112
- return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
45112
+ return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo), state);
45113
45113
  }
45114
45114
  function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
45115
45115
  if (!resolveJs && packageJsonInfo.contents.resolvedEntrypoints !== void 0) {
@@ -45127,8 +45127,7 @@ function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache
45127
45127
  /*onlyRecordFailures*/
45128
45128
  false,
45129
45129
  loadPackageJsonMainState,
45130
- packageJsonInfo.contents.packageJsonContent,
45131
- getVersionPathsOfPackageJsonInfo(packageJsonInfo, loadPackageJsonMainState)
45130
+ packageJsonInfo
45132
45131
  );
45133
45132
  entrypoints = append(entrypoints, mainResolution == null ? void 0 : mainResolution.path);
45134
45133
  if (features & 8 /* Exports */ && packageJsonInfo.contents.packageJsonContent.exports) {
@@ -45331,13 +45330,14 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
45331
45330
  (_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath);
45332
45331
  }
45333
45332
  }
45334
- function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
45333
+ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJson) {
45334
+ const versionPaths = packageJson && getVersionPathsOfPackageJsonInfo(packageJson, state);
45335
45335
  let packageFile;
45336
- if (jsonContent) {
45336
+ if (packageJson && arePathsEqual(packageJson == null ? void 0 : packageJson.packageDirectory, candidate, state.host)) {
45337
45337
  if (state.isConfigLookup) {
45338
- packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
45338
+ packageFile = readPackageJsonTSConfigField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state);
45339
45339
  } else {
45340
- packageFile = extensions & 4 /* Declaration */ && readPackageJsonTypesFields(jsonContent, candidate, state) || extensions & (3 /* ImplementationFiles */ | 4 /* Declaration */) && readPackageJsonMainField(jsonContent, candidate, state) || void 0;
45340
+ packageFile = extensions & 4 /* Declaration */ && readPackageJsonTypesFields(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || extensions & (3 /* ImplementationFiles */ | 4 /* Declaration */) && readPackageJsonMainField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || void 0;
45341
45341
  }
45342
45342
  }
45343
45343
  const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
@@ -45356,7 +45356,7 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
45356
45356
  const features = state2.features;
45357
45357
  const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
45358
45358
  state2.candidateIsFromPackageJsonField = true;
45359
- if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
45359
+ if ((packageJson == null ? void 0 : packageJson.contents.packageJsonContent.type) !== "module") {
45360
45360
  state2.features &= ~32 /* EsmMode */;
45361
45361
  }
45362
45362
  const result = nodeLoadModuleByRelativeName(
@@ -45959,8 +45959,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
45959
45959
  candidate,
45960
45960
  !nodeModulesDirectoryExists,
45961
45961
  state,
45962
- packageInfo.contents.packageJsonContent,
45963
- getVersionPathsOfPackageJsonInfo(packageInfo, state)
45962
+ packageInfo
45964
45963
  );
45965
45964
  return withPackageId(packageInfo, fromDirectory, state);
45966
45965
  }
@@ -45970,8 +45969,7 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
45970
45969
  candidate2,
45971
45970
  onlyRecordFailures,
45972
45971
  state2,
45973
- packageInfo && packageInfo.contents.packageJsonContent,
45974
- packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state2)
45972
+ packageInfo
45975
45973
  );
45976
45974
  if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
45977
45975
  pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
@@ -51404,6 +51402,12 @@ function createTypeChecker(host) {
51404
51402
  /*isReadonly*/
51405
51403
  true
51406
51404
  );
51405
+ var anyBaseTypeIndexInfo = createIndexInfo(
51406
+ stringType,
51407
+ anyType,
51408
+ /*isReadonly*/
51409
+ false
51410
+ );
51407
51411
  var iterationTypesCache = /* @__PURE__ */ new Map();
51408
51412
  var noIterationTypes = {
51409
51413
  get yieldType() {
@@ -61346,12 +61350,7 @@ function createTypeChecker(host) {
61346
61350
  addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType));
61347
61351
  callSignatures = concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */));
61348
61352
  constructSignatures = concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */));
61349
- const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [createIndexInfo(
61350
- stringType,
61351
- anyType,
61352
- /*isReadonly*/
61353
- false
61354
- )];
61353
+ const inheritedIndexInfos = instantiatedBaseType !== anyType ? getIndexInfosOfType(instantiatedBaseType) : [anyBaseTypeIndexInfo];
61355
61354
  indexInfos = concatenate(indexInfos, filter(inheritedIndexInfos, (info) => !findIndexInfo(indexInfos, info.keyType)));
61356
61355
  }
61357
61356
  }
@@ -61877,12 +61876,7 @@ function createTypeChecker(host) {
61877
61876
  members = createSymbolTable(getNamedOrIndexSignatureMembers(members));
61878
61877
  addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
61879
61878
  } else if (baseConstructorType === anyType) {
61880
- baseConstructorIndexInfo = createIndexInfo(
61881
- stringType,
61882
- anyType,
61883
- /*isReadonly*/
61884
- false
61885
- );
61879
+ baseConstructorIndexInfo = anyBaseTypeIndexInfo;
61886
61880
  }
61887
61881
  }
61888
61882
  const indexSymbol = getIndexSymbolFromSymbolTable(members);
@@ -73043,14 +73037,20 @@ function createTypeChecker(host) {
73043
73037
  }
73044
73038
  return false;
73045
73039
  }
73046
- function isDiscriminantProperty(type, name) {
73040
+ function isDiscriminantProperty(type, name, considerNonUniformPrimitivePropDiscriminant = true) {
73041
+ var _a;
73047
73042
  if (type && type.flags & 1048576 /* Union */) {
73048
73043
  const prop = getUnionOrIntersectionProperty(type, name);
73049
73044
  if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) {
73050
- if (prop.links.isDiscriminantProperty === void 0) {
73051
- prop.links.isDiscriminantProperty = (prop.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop));
73045
+ const propType = getTypeOfSymbol(prop);
73046
+ const transientSymbol = prop;
73047
+ (_a = transientSymbol.links).isDiscriminantProperty ?? (_a.isDiscriminantProperty = /* @__PURE__ */ new Map());
73048
+ let isDiscriminant = transientSymbol.links.isDiscriminantProperty.get(considerNonUniformPrimitivePropDiscriminant);
73049
+ if (typeof isDiscriminant === "undefined") {
73050
+ isDiscriminant = ((transientSymbol.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ || !!(considerNonUniformPrimitivePropDiscriminant && transientSymbol.links.checkFlags & 64 /* HasNonUniformType */ && someType(propType, (t) => !!(t.flags & 402784252 /* Primitive */)))) && !isGenericType(propType);
73051
+ transientSymbol.links.isDiscriminantProperty.set(considerNonUniformPrimitivePropDiscriminant, isDiscriminant);
73052
73052
  }
73053
- return !!prop.links.isDiscriminantProperty;
73053
+ return isDiscriminant;
73054
73054
  }
73055
73055
  }
73056
73056
  return false;
@@ -73058,7 +73058,12 @@ function createTypeChecker(host) {
73058
73058
  function findDiscriminantProperties(sourceProperties, target) {
73059
73059
  let result;
73060
73060
  for (const sourceProperty of sourceProperties) {
73061
- if (isDiscriminantProperty(target, sourceProperty.escapedName)) {
73061
+ if (isDiscriminantProperty(
73062
+ target,
73063
+ sourceProperty.escapedName,
73064
+ /*considerNonUniformPrimitivePropDiscriminant*/
73065
+ false
73066
+ )) {
73062
73067
  if (result) {
73063
73068
  result.push(sourceProperty);
73064
73069
  continue;
@@ -75281,12 +75286,13 @@ function createTypeChecker(host) {
75281
75286
  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;
75282
75287
  const jsxFactoryNamespace = getJsxNamespace(node);
75283
75288
  const jsxFactoryLocation = isJsxOpeningLikeElement(node) ? node.tagName : node;
75289
+ const shouldFactoryRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */;
75284
75290
  let jsxFactorySym;
75285
75291
  if (!(isJsxOpeningFragment(node) && jsxFactoryNamespace === "null")) {
75286
75292
  jsxFactorySym = resolveName(
75287
75293
  jsxFactoryLocation,
75288
75294
  jsxFactoryNamespace,
75289
- compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
75295
+ shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
75290
75296
  jsxFactoryRefErr,
75291
75297
  /*isUse*/
75292
75298
  true
@@ -75300,12 +75306,13 @@ function createTypeChecker(host) {
75300
75306
  }
75301
75307
  if (isJsxOpeningFragment(node)) {
75302
75308
  const file = getSourceFileOfNode(node);
75303
- const localJsxNamespace = getLocalJsxNamespace(file);
75304
- if (localJsxNamespace) {
75309
+ const entity = getJsxFactoryEntity(file);
75310
+ if (entity) {
75311
+ const localJsxNamespace = getFirstIdentifier(entity).escapedText;
75305
75312
  resolveName(
75306
75313
  jsxFactoryLocation,
75307
75314
  localJsxNamespace,
75308
- compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
75315
+ shouldFactoryRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
75309
75316
  jsxFactoryRefErr,
75310
75317
  /*isUse*/
75311
75318
  true
@@ -78880,6 +78887,13 @@ function createTypeChecker(host) {
78880
78887
  return getIntersectionType(x);
78881
78888
  }
78882
78889
  function reportNonexistentProperty(propNode, containingType, isUncheckedJS) {
78890
+ const links = getNodeLinks(propNode);
78891
+ const cache = links.nonExistentPropCheckCache || (links.nonExistentPropCheckCache = /* @__PURE__ */ new Set());
78892
+ const key = `${getTypeId(containingType)}|${isUncheckedJS}`;
78893
+ if (cache.has(key)) {
78894
+ return;
78895
+ }
78896
+ cache.add(key);
78883
78897
  let errorInfo;
78884
78898
  let relatedInfo;
78885
78899
  if (!isPrivateIdentifier(propNode) && containingType.flags & 1048576 /* Union */ && !(containingType.flags & 402784252 /* Primitive */)) {
@@ -80843,12 +80857,14 @@ function createTypeChecker(host) {
80843
80857
  const sourceFileLinks = getNodeLinks(getSourceFileOfNode(node));
80844
80858
  if (sourceFileLinks.jsxFragmentType !== void 0) return sourceFileLinks.jsxFragmentType;
80845
80859
  const jsxFragmentFactoryName = getJsxNamespace(node);
80846
- if (jsxFragmentFactoryName === "null") return sourceFileLinks.jsxFragmentType = anyType;
80860
+ const shouldResolveFactoryReference = (compilerOptions.jsx === 2 /* React */ || compilerOptions.jsxFragmentFactory !== void 0) && jsxFragmentFactoryName !== "null";
80861
+ if (!shouldResolveFactoryReference) return sourceFileLinks.jsxFragmentType = anyType;
80862
+ const shouldModuleRefErr = compilerOptions.jsx !== 1 /* Preserve */ && compilerOptions.jsx !== 3 /* ReactNative */;
80847
80863
  const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : void 0;
80848
80864
  const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? resolveName(
80849
80865
  node,
80850
80866
  jsxFragmentFactoryName,
80851
- compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
80867
+ shouldModuleRefErr ? 111551 /* Value */ : 111551 /* Value */ & ~384 /* Enum */,
80852
80868
  /*nameNotFoundMessage*/
80853
80869
  jsxFactoryRefErr,
80854
80870
  /*isUse*/
@@ -88703,6 +88719,13 @@ function createTypeChecker(host) {
88703
88719
  function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, member, errorNode) {
88704
88720
  const isJs = isInJSFile(node);
88705
88721
  const nodeInAmbientContext = !!(node.flags & 33554432 /* Ambient */);
88722
+ if (memberHasOverrideModifier && (member == null ? void 0 : member.valueDeclaration) && isClassElement(member.valueDeclaration) && member.valueDeclaration.name && isNonBindableDynamicName(member.valueDeclaration.name)) {
88723
+ error2(
88724
+ errorNode,
88725
+ isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic : Diagnostics.This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic
88726
+ );
88727
+ return 2 /* HasInvalidOverride */;
88728
+ }
88706
88729
  if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
88707
88730
  const thisType = memberIsStatic ? staticType : typeWithThis;
88708
88731
  const baseType = memberIsStatic ? baseStaticType : baseWithThis;
@@ -92037,6 +92060,7 @@ function createTypeChecker(host) {
92037
92060
  result || (result = []);
92038
92061
  for (const info of infoList) {
92039
92062
  if (info.declaration) continue;
92063
+ if (info === anyBaseTypeIndexInfo) continue;
92040
92064
  const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
92041
92065
  if (node && infoList === staticInfos) {
92042
92066
  (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
@@ -157315,6 +157339,7 @@ var errorCodes19 = [
157315
157339
  Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,
157316
157340
  Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code,
157317
157341
  Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,
157342
+ Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code,
157318
157343
  Diagnostics.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found.code
157319
157344
  ];
157320
157345
  registerCodeFix({
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.8.0-pr-60576-12",
5
+ "version": "5.8.0-pr-60718-25",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [