@typescript-deploys/pr-build 5.3.0-pr-56201-9 → 5.3.0-pr-56218-11

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.3";
21
- var version = `${versionMajorMinor}.0-insiders.20231024`;
21
+ var version = `${versionMajorMinor}.0-insiders.20231025`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -42747,10 +42747,10 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
42747
42747
  return ending !== 0 /* Minimal */ || value === processEnding(relativeToBaseUrl, [ending], compilerOptions, host);
42748
42748
  }
42749
42749
  }
42750
- function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports, conditions, mode = 0 /* Exact */) {
42751
- if (typeof exports === "string") {
42750
+ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, exports2, conditions, mode = 0 /* Exact */) {
42751
+ if (typeof exports2 === "string") {
42752
42752
  const pathOrPattern = getNormalizedAbsolutePath(
42753
- combinePaths(packageDirectory, exports),
42753
+ combinePaths(packageDirectory, exports2),
42754
42754
  /*currentDirectory*/
42755
42755
  void 0
42756
42756
  );
@@ -42770,7 +42770,7 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
42770
42770
  false
42771
42771
  );
42772
42772
  return { moduleFileToTry: getNormalizedAbsolutePath(
42773
- combinePaths(combinePaths(packageName, exports), fragment),
42773
+ combinePaths(combinePaths(packageName, exports2), fragment),
42774
42774
  /*currentDirectory*/
42775
42775
  void 0
42776
42776
  ) };
@@ -42790,23 +42790,23 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
42790
42790
  }
42791
42791
  break;
42792
42792
  }
42793
- } else if (Array.isArray(exports)) {
42794
- return forEach(exports, (e) => tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, e, conditions));
42795
- } else if (typeof exports === "object" && exports !== null) {
42796
- if (allKeysStartWithDot(exports)) {
42797
- return forEach(getOwnKeys(exports), (k) => {
42793
+ } else if (Array.isArray(exports2)) {
42794
+ return forEach(exports2, (e) => tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, e, conditions));
42795
+ } else if (typeof exports2 === "object" && exports2 !== null) {
42796
+ if (allKeysStartWithDot(exports2)) {
42797
+ return forEach(getOwnKeys(exports2), (k) => {
42798
42798
  const subPackageName = getNormalizedAbsolutePath(
42799
42799
  combinePaths(packageName, k),
42800
42800
  /*currentDirectory*/
42801
42801
  void 0
42802
42802
  );
42803
42803
  const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
42804
- return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
42804
+ return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports2[k], conditions, mode2);
42805
42805
  });
42806
42806
  } else {
42807
- for (const key of getOwnKeys(exports)) {
42807
+ for (const key of getOwnKeys(exports2)) {
42808
42808
  if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
42809
- const subTarget = exports[key];
42809
+ const subTarget = exports2[key];
42810
42810
  const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
42811
42811
  if (result) {
42812
42812
  return result;
@@ -45888,13 +45888,13 @@ function createTypeChecker(host) {
45888
45888
  function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
45889
45889
  var _a, _b;
45890
45890
  const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(name.escapedText);
45891
- const exports = moduleSymbol.exports;
45891
+ const exports2 = moduleSymbol.exports;
45892
45892
  if (localSymbol) {
45893
- const exportedEqualsSymbol = exports == null ? void 0 : exports.get("export=" /* ExportEquals */);
45893
+ const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */);
45894
45894
  if (exportedEqualsSymbol) {
45895
45895
  getSymbolIfSameReference(exportedEqualsSymbol, localSymbol) ? reportInvalidImportEqualsExportMember(node, name, declarationName, moduleName) : error(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName);
45896
45896
  } else {
45897
- const exportedSymbol = exports ? find(symbolsToArray(exports), (symbol) => !!getSymbolIfSameReference(symbol, localSymbol)) : void 0;
45897
+ const exportedSymbol = exports2 ? find(symbolsToArray(exports2), (symbol) => !!getSymbolIfSameReference(symbol, localSymbol)) : void 0;
45898
45898
  const diagnostic = exportedSymbol ? error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2, moduleName, declarationName, symbolToString(exportedSymbol)) : error(name, Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
45899
45899
  if (localSymbol.declarations) {
45900
45900
  addRelatedInfo(diagnostic, ...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName)));
@@ -46758,19 +46758,19 @@ function createTypeChecker(host) {
46758
46758
  return symbolsToArray(getExportsOfModule(moduleSymbol));
46759
46759
  }
46760
46760
  function getExportsAndPropertiesOfModule(moduleSymbol) {
46761
- const exports = getExportsOfModuleAsArray(moduleSymbol);
46761
+ const exports2 = getExportsOfModuleAsArray(moduleSymbol);
46762
46762
  const exportEquals = resolveExternalModuleSymbol(moduleSymbol);
46763
46763
  if (exportEquals !== moduleSymbol) {
46764
46764
  const type = getTypeOfSymbol(exportEquals);
46765
46765
  if (shouldTreatPropertiesOfExternalModuleAsExports(type)) {
46766
- addRange(exports, getPropertiesOfType(type));
46766
+ addRange(exports2, getPropertiesOfType(type));
46767
46767
  }
46768
46768
  }
46769
- return exports;
46769
+ return exports2;
46770
46770
  }
46771
46771
  function forEachExportAndPropertyOfModule(moduleSymbol, cb) {
46772
- const exports = getExportsOfModule(moduleSymbol);
46773
- exports.forEach((symbol, key) => {
46772
+ const exports2 = getExportsOfModule(moduleSymbol);
46773
+ exports2.forEach((symbol, key) => {
46774
46774
  if (!isReservedMemberName(key)) {
46775
46775
  cb(symbol, key);
46776
46776
  }
@@ -46813,8 +46813,8 @@ function createTypeChecker(host) {
46813
46813
  function getExportsOfModule(moduleSymbol) {
46814
46814
  const links = getSymbolLinks(moduleSymbol);
46815
46815
  if (!links.resolvedExports) {
46816
- const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
46817
- links.resolvedExports = exports;
46816
+ const { exports: exports2, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
46817
+ links.resolvedExports = exports2;
46818
46818
  links.typeOnlyExportStarMap = typeOnlyExportStarMap;
46819
46819
  }
46820
46820
  return links.resolvedExports;
@@ -46848,12 +46848,12 @@ function createTypeChecker(host) {
46848
46848
  let typeOnlyExportStarMap;
46849
46849
  const nonTypeOnlyNames = /* @__PURE__ */ new Set();
46850
46850
  moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
46851
- const exports = visit(moduleSymbol) || emptySymbols;
46851
+ const exports2 = visit(moduleSymbol) || emptySymbols;
46852
46852
  if (typeOnlyExportStarMap) {
46853
46853
  nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name));
46854
46854
  }
46855
46855
  return {
46856
- exports,
46856
+ exports: exports2,
46857
46857
  typeOnlyExportStarMap
46858
46858
  };
46859
46859
  function visit(symbol, exportStar, isTypeOnly) {
@@ -47038,12 +47038,12 @@ function createTypeChecker(host) {
47038
47038
  if (exportEquals && getSymbolIfSameReference(exportEquals, symbol)) {
47039
47039
  return container;
47040
47040
  }
47041
- const exports = getExportsOfSymbol(container);
47042
- const quick = exports.get(symbol.escapedName);
47041
+ const exports2 = getExportsOfSymbol(container);
47042
+ const quick = exports2.get(symbol.escapedName);
47043
47043
  if (quick && getSymbolIfSameReference(quick, symbol)) {
47044
47044
  return quick;
47045
47045
  }
47046
- return forEachEntry(exports, (exported) => {
47046
+ return forEachEntry(exports2, (exported) => {
47047
47047
  if (getSymbolIfSameReference(exported, symbol)) {
47048
47048
  return exported;
47049
47049
  }
@@ -49242,8 +49242,8 @@ function createTypeChecker(host) {
49242
49242
  context.flags ^= 16777216 /* InInitialEntityName */;
49243
49243
  } else {
49244
49244
  if (parent && getExportsOfSymbol(parent)) {
49245
- const exports = getExportsOfSymbol(parent);
49246
- forEachEntry(exports, (ex, name) => {
49245
+ const exports2 = getExportsOfSymbol(parent);
49246
+ forEachEntry(exports2, (ex, name) => {
49247
49247
  if (getSymbolIfSameReference(ex, symbol2) && !isLateBoundName(name) && name !== "export=" /* ExportEquals */) {
49248
49248
  symbolName2 = unescapeLeadingUnderscores(name);
49249
49249
  return true;
@@ -49867,8 +49867,8 @@ function createTypeChecker(host) {
49867
49867
  return statements;
49868
49868
  }
49869
49869
  function mergeExportDeclarations(statements) {
49870
- const exports = filter(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && isNamedExports(d.exportClause));
49871
- if (length(exports) > 1) {
49870
+ const exports2 = filter(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !!d.exportClause && isNamedExports(d.exportClause));
49871
+ if (length(exports2) > 1) {
49872
49872
  const nonExports = filter(statements, (d) => !isExportDeclaration(d) || !!d.moduleSpecifier || !d.exportClause);
49873
49873
  statements = [
49874
49874
  ...nonExports,
@@ -49877,7 +49877,7 @@ function createTypeChecker(host) {
49877
49877
  void 0,
49878
49878
  /*isTypeOnly*/
49879
49879
  false,
49880
- factory.createNamedExports(flatMap(exports, (e) => cast(e.exportClause, isNamedExports).elements)),
49880
+ factory.createNamedExports(flatMap(exports2, (e) => cast(e.exportClause, isNamedExports).elements)),
49881
49881
  /*moduleSpecifier*/
49882
49882
  void 0
49883
49883
  )
@@ -50254,8 +50254,8 @@ function createTypeChecker(host) {
50254
50254
  );
50255
50255
  }
50256
50256
  function getNamespaceMembersForSerialization(symbol) {
50257
- const exports = getExportsOfSymbol(symbol);
50258
- return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
50257
+ const exports2 = getExportsOfSymbol(symbol);
50258
+ return !exports2 ? [] : filter(arrayFrom(exports2.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
50259
50259
  }
50260
50260
  function isTypeOnlyNamespace(symbol) {
50261
50261
  return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
@@ -52057,19 +52057,19 @@ function createTypeChecker(host) {
52057
52057
  if (!isInJSFile(decl) || !init || !isObjectLiteralExpression(init) || init.properties.length) {
52058
52058
  return void 0;
52059
52059
  }
52060
- const exports = createSymbolTable();
52060
+ const exports2 = createSymbolTable();
52061
52061
  while (isBinaryExpression(decl) || isPropertyAccessExpression(decl)) {
52062
52062
  const s2 = getSymbolOfNode(decl);
52063
52063
  if ((_a = s2 == null ? void 0 : s2.exports) == null ? void 0 : _a.size) {
52064
- mergeSymbolTable(exports, s2.exports);
52064
+ mergeSymbolTable(exports2, s2.exports);
52065
52065
  }
52066
52066
  decl = isBinaryExpression(decl) ? decl.parent : decl.parent.parent;
52067
52067
  }
52068
52068
  const s = getSymbolOfNode(decl);
52069
52069
  if ((_b = s == null ? void 0 : s.exports) == null ? void 0 : _b.size) {
52070
- mergeSymbolTable(exports, s.exports);
52070
+ mergeSymbolTable(exports2, s.exports);
52071
52071
  }
52072
- const type = createAnonymousType(symbol, exports, emptyArray, emptyArray, emptyArray);
52072
+ const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray);
52073
52073
  type.objectFlags |= 4096 /* JSLiteral */;
52074
52074
  return type;
52075
52075
  }
@@ -59911,8 +59911,8 @@ function createTypeChecker(host) {
59911
59911
  const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
59912
59912
  const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
59913
59913
  if (sourceType && targetType) {
59914
- const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
59915
- const targetSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
59914
+ const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
59915
+ const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
59916
59916
  const callbacks = sourceSig && targetSig && !getTypePredicateOfSignature(sourceSig) && !getTypePredicateOfSignature(targetSig) && getTypeFacts(sourceType, 50331648 /* IsUndefinedOrNull */) === getTypeFacts(targetType, 50331648 /* IsUndefinedOrNull */);
59917
59917
  let related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, checkMode & 8 /* StrictArity */ | (strictVariance ? 2 /* StrictCallback */ : 1 /* BivariantCallback */), reportErrors2, errorReporter, incompatibleErrorReporter, compareTypes, reportUnreliableMarkers) : !(checkMode & 3 /* Callback */) && !strictVariance && compareTypes(
59918
59918
  sourceType,
@@ -67786,7 +67786,7 @@ function createTypeChecker(host) {
67786
67786
  type,
67787
67787
  (t) => {
67788
67788
  var _a;
67789
- if (isGenericMappedType(t) && (!t.declaration.nameType || isFilteringMappedType(t))) {
67789
+ if (isGenericMappedType(t) && !t.declaration.nameType) {
67790
67790
  const constraint = getConstraintTypeFromMappedType(t);
67791
67791
  const constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
67792
67792
  const propertyNameType = nameType || getStringLiteralType(unescapeLeadingUnderscores(name));
@@ -69034,8 +69034,8 @@ function createTypeChecker(host) {
69034
69034
  }
69035
69035
  function getJsxType(name, location) {
69036
69036
  const namespace = getJsxNamespaceAt(location);
69037
- const exports = namespace && getExportsOfSymbol(namespace);
69038
- const typeSymbol = exports && getSymbol(exports, name, 788968 /* Type */);
69037
+ const exports2 = namespace && getExportsOfSymbol(namespace);
69038
+ const typeSymbol = exports2 && getSymbol(exports2, name, 788968 /* Type */);
69039
69039
  return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : errorType;
69040
69040
  }
69041
69041
  function getIntrinsicTagSymbol(node) {
@@ -70413,6 +70413,10 @@ function createTypeChecker(host) {
70413
70413
  const minTypeArgumentCount = getMinTypeArgumentCount(signature.typeParameters);
70414
70414
  return !some(typeArguments) || typeArguments.length >= minTypeArgumentCount && typeArguments.length <= numTypeParameters;
70415
70415
  }
70416
+ function isInstantiatedGenericParameter(signature, pos) {
70417
+ let type;
70418
+ return !!(signature.target && (type = tryGetTypeAtPosition(signature.target, pos)) && isGenericType(type));
70419
+ }
70416
70420
  function getSingleCallSignature(type) {
70417
70421
  return getSingleSignature(
70418
70422
  type,
@@ -71859,8 +71863,8 @@ function createTypeChecker(host) {
71859
71863
  }
71860
71864
  function createSignatureForJSXIntrinsic(node, result) {
71861
71865
  const namespace = getJsxNamespaceAt(node);
71862
- const exports = namespace && getExportsOfSymbol(namespace);
71863
- const typeSymbol = exports && getSymbol(exports, JsxNames.Element, 788968 /* Type */);
71866
+ const exports2 = namespace && getExportsOfSymbol(namespace);
71867
+ const typeSymbol = exports2 && getSymbol(exports2, JsxNames.Element, 788968 /* Type */);
71864
71868
  const returnNode = typeSymbol && nodeBuilder.symbolToEntityName(typeSymbol, 788968 /* Type */, node);
71865
71869
  const declaration = factory.createFunctionTypeNode(
71866
71870
  /*typeParameters*/
@@ -80567,9 +80571,9 @@ function createTypeChecker(host) {
80567
80571
  error(declaration, Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
80568
80572
  }
80569
80573
  }
80570
- const exports = getExportsOfModule(moduleSymbol);
80571
- if (exports) {
80572
- exports.forEach(({ declarations, flags }, id) => {
80574
+ const exports2 = getExportsOfModule(moduleSymbol);
80575
+ if (exports2) {
80576
+ exports2.forEach(({ declarations, flags }, id) => {
80573
80577
  if (id === "__export") {
80574
80578
  return;
80575
80579
  }
@@ -82425,8 +82429,8 @@ function createTypeChecker(host) {
82425
82429
  return false;
82426
82430
  if (importTarget === file)
82427
82431
  return false;
82428
- const exports = getExportsOfModule(file.symbol);
82429
- for (const s of arrayFrom(exports.values())) {
82432
+ const exports2 = getExportsOfModule(file.symbol);
82433
+ for (const s of arrayFrom(exports2.values())) {
82430
82434
  if (s.mergeId) {
82431
82435
  const merged = getMergedSymbol(s);
82432
82436
  if (merged.declarations) {
@@ -105568,7 +105572,7 @@ function transformSystemModule(context) {
105568
105572
  const exportStarFunction = factory2.createUniqueName("exportStar");
105569
105573
  const m = factory2.createIdentifier("m");
105570
105574
  const n = factory2.createIdentifier("n");
105571
- const exports = factory2.createIdentifier("exports");
105575
+ const exports2 = factory2.createIdentifier("exports");
105572
105576
  let condition = factory2.createStrictInequality(n, factory2.createStringLiteral("default"));
105573
105577
  if (localNames) {
105574
105578
  condition = factory2.createLogicalAnd(
@@ -105607,7 +105611,7 @@ function transformSystemModule(context) {
105607
105611
  void 0,
105608
105612
  factory2.createVariableDeclarationList([
105609
105613
  factory2.createVariableDeclaration(
105610
- exports,
105614
+ exports2,
105611
105615
  /*exclamationToken*/
105612
105616
  void 0,
105613
105617
  /*type*/
@@ -105627,7 +105631,7 @@ function transformSystemModule(context) {
105627
105631
  condition,
105628
105632
  factory2.createExpressionStatement(
105629
105633
  factory2.createAssignment(
105630
- factory2.createElementAccessExpression(exports, n),
105634
+ factory2.createElementAccessExpression(exports2, n),
105631
105635
  factory2.createElementAccessExpression(m, n)
105632
105636
  )
105633
105637
  )
@@ -105641,7 +105645,7 @@ function transformSystemModule(context) {
105641
105645
  exportFunction,
105642
105646
  /*typeArguments*/
105643
105647
  void 0,
105644
- [exports]
105648
+ [exports2]
105645
105649
  )
105646
105650
  )
105647
105651
  ],