@typescript-deploys/pr-build 5.7.0-pr-60121-9 → 5.7.0-pr-60122-16

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.7";
21
- var version = `${versionMajorMinor}.0-insiders.20241003`;
21
+ var version = `${versionMajorMinor}.0-insiders.20241004`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -70426,7 +70426,7 @@ function createTypeChecker(host) {
70426
70426
  jsxFactorySym = resolveName(
70427
70427
  jsxFactoryLocation,
70428
70428
  jsxFactoryNamespace,
70429
- 111551 /* Value */,
70429
+ compilerOptions.jsx === 1 /* Preserve */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
70430
70430
  jsxFactoryRefErr,
70431
70431
  /*isUse*/
70432
70432
  true
@@ -70445,7 +70445,7 @@ function createTypeChecker(host) {
70445
70445
  resolveName(
70446
70446
  jsxFactoryLocation,
70447
70447
  localJsxNamespace,
70448
- 111551 /* Value */,
70448
+ compilerOptions.jsx === 1 /* Preserve */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
70449
70449
  jsxFactoryRefErr,
70450
70450
  /*isUse*/
70451
70451
  true
@@ -72903,7 +72903,8 @@ function createTypeChecker(host) {
72903
72903
  );
72904
72904
  }
72905
72905
  checkJsxChildren(node);
72906
- return getJsxElementTypeAt(node) || anyType;
72906
+ const jsxElementType = getJsxElementTypeAt(node);
72907
+ return isErrorType(jsxElementType) ? anyType : jsxElementType;
72907
72908
  }
72908
72909
  function isHyphenatedJsxName(name) {
72909
72910
  return name.includes("-");
@@ -75963,11 +75964,12 @@ function createTypeChecker(host) {
75963
75964
  const sourceFileLinks = getNodeLinks(getSourceFileOfNode(node));
75964
75965
  if (sourceFileLinks.jsxFragmentType !== void 0) return sourceFileLinks.jsxFragmentType;
75965
75966
  const jsxFragmentFactoryName = getJsxNamespace(node);
75967
+ if (jsxFragmentFactoryName === "null") return sourceFileLinks.jsxFragmentType = anyType;
75966
75968
  const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : void 0;
75967
75969
  const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? resolveName(
75968
75970
  node,
75969
75971
  jsxFragmentFactoryName,
75970
- 111551 /* Value */,
75972
+ compilerOptions.jsx === 1 /* Preserve */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
75971
75973
  /*nameNotFoundMessage*/
75972
75974
  jsxFactoryRefErr,
75973
75975
  /*isUse*/
@@ -81902,11 +81904,8 @@ function createTypeChecker(host) {
81902
81904
  }
81903
81905
  const parent = node.parent.parent;
81904
81906
  const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
81907
+ const parentType = getTypeForBindingElementParent(parent, parentCheckMode);
81905
81908
  const name = node.propertyName || node.name;
81906
- let parentType = getTypeForBindingElementParent(parent, parentCheckMode);
81907
- if (parentType && !parent.initializer) {
81908
- parentType = checkNonNullType(parentType, parent);
81909
- }
81910
81909
  if (parentType && !isBindingPattern(name)) {
81911
81910
  const exprType = getLiteralTypeFromPropertyName(name);
81912
81911
  if (isTypeUsableAsPropertyName(exprType)) {
@@ -81946,15 +81945,16 @@ function createTypeChecker(host) {
81946
81945
  if (isInAmbientOrTypeNode(node)) {
81947
81946
  return;
81948
81947
  }
81949
- const needCheckInitializer = node.initializer && node.parent.parent.kind !== 249 /* ForInStatement */;
81948
+ const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 249 /* ForInStatement */;
81950
81949
  const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression));
81951
81950
  if (needCheckInitializer || needCheckWidenedType) {
81952
81951
  const widenedType = getWidenedTypeForVariableLikeDeclaration(node);
81953
81952
  if (needCheckInitializer) {
81953
+ const initializerType = checkExpressionCached(node.initializer);
81954
81954
  if (strictNullChecks && needCheckWidenedType) {
81955
- checkNonNullNonVoidType(checkExpressionCached(node.initializer), node);
81955
+ checkNonNullNonVoidType(initializerType, node);
81956
81956
  } else {
81957
- checkTypeAssignableToAndOptionallyElaborate(checkNonNullExpression(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);
81957
+ checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);
81958
81958
  }
81959
81959
  }
81960
81960
  if (needCheckWidenedType) {
package/lib/typescript.js CHANGED
@@ -2277,7 +2277,7 @@ module.exports = __toCommonJS(typescript_exports);
2277
2277
 
2278
2278
  // src/compiler/corePublic.ts
2279
2279
  var versionMajorMinor = "5.7";
2280
- var version = `${versionMajorMinor}.0-insiders.20241003`;
2280
+ var version = `${versionMajorMinor}.0-insiders.20241004`;
2281
2281
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2282
2282
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2283
2283
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -75029,7 +75029,7 @@ function createTypeChecker(host) {
75029
75029
  jsxFactorySym = resolveName(
75030
75030
  jsxFactoryLocation,
75031
75031
  jsxFactoryNamespace,
75032
- 111551 /* Value */,
75032
+ compilerOptions.jsx === 1 /* Preserve */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
75033
75033
  jsxFactoryRefErr,
75034
75034
  /*isUse*/
75035
75035
  true
@@ -75048,7 +75048,7 @@ function createTypeChecker(host) {
75048
75048
  resolveName(
75049
75049
  jsxFactoryLocation,
75050
75050
  localJsxNamespace,
75051
- 111551 /* Value */,
75051
+ compilerOptions.jsx === 1 /* Preserve */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
75052
75052
  jsxFactoryRefErr,
75053
75053
  /*isUse*/
75054
75054
  true
@@ -77506,7 +77506,8 @@ function createTypeChecker(host) {
77506
77506
  );
77507
77507
  }
77508
77508
  checkJsxChildren(node);
77509
- return getJsxElementTypeAt(node) || anyType;
77509
+ const jsxElementType = getJsxElementTypeAt(node);
77510
+ return isErrorType(jsxElementType) ? anyType : jsxElementType;
77510
77511
  }
77511
77512
  function isHyphenatedJsxName(name) {
77512
77513
  return name.includes("-");
@@ -80566,11 +80567,12 @@ function createTypeChecker(host) {
80566
80567
  const sourceFileLinks = getNodeLinks(getSourceFileOfNode(node));
80567
80568
  if (sourceFileLinks.jsxFragmentType !== void 0) return sourceFileLinks.jsxFragmentType;
80568
80569
  const jsxFragmentFactoryName = getJsxNamespace(node);
80570
+ if (jsxFragmentFactoryName === "null") return sourceFileLinks.jsxFragmentType = anyType;
80569
80571
  const jsxFactoryRefErr = diagnostics ? Diagnostics.Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found : void 0;
80570
80572
  const jsxFactorySymbol = getJsxNamespaceContainerForImplicitImport(node) ?? resolveName(
80571
80573
  node,
80572
80574
  jsxFragmentFactoryName,
80573
- 111551 /* Value */,
80575
+ compilerOptions.jsx === 1 /* Preserve */ ? 111551 /* Value */ & ~384 /* Enum */ : 111551 /* Value */,
80574
80576
  /*nameNotFoundMessage*/
80575
80577
  jsxFactoryRefErr,
80576
80578
  /*isUse*/
@@ -86505,11 +86507,8 @@ function createTypeChecker(host) {
86505
86507
  }
86506
86508
  const parent2 = node.parent.parent;
86507
86509
  const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
86510
+ const parentType = getTypeForBindingElementParent(parent2, parentCheckMode);
86508
86511
  const name = node.propertyName || node.name;
86509
- let parentType = getTypeForBindingElementParent(parent2, parentCheckMode);
86510
- if (parentType && !parent2.initializer) {
86511
- parentType = checkNonNullType(parentType, parent2);
86512
- }
86513
86512
  if (parentType && !isBindingPattern(name)) {
86514
86513
  const exprType = getLiteralTypeFromPropertyName(name);
86515
86514
  if (isTypeUsableAsPropertyName(exprType)) {
@@ -86549,15 +86548,16 @@ function createTypeChecker(host) {
86549
86548
  if (isInAmbientOrTypeNode(node)) {
86550
86549
  return;
86551
86550
  }
86552
- const needCheckInitializer = node.initializer && node.parent.parent.kind !== 249 /* ForInStatement */;
86551
+ const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 249 /* ForInStatement */;
86553
86552
  const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression));
86554
86553
  if (needCheckInitializer || needCheckWidenedType) {
86555
86554
  const widenedType = getWidenedTypeForVariableLikeDeclaration(node);
86556
86555
  if (needCheckInitializer) {
86556
+ const initializerType = checkExpressionCached(node.initializer);
86557
86557
  if (strictNullChecks && needCheckWidenedType) {
86558
- checkNonNullNonVoidType(checkExpressionCached(node.initializer), node);
86558
+ checkNonNullNonVoidType(initializerType, node);
86559
86559
  } else {
86560
- checkTypeAssignableToAndOptionallyElaborate(checkNonNullExpression(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);
86560
+ checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);
86561
86561
  }
86562
86562
  }
86563
86563
  if (needCheckWidenedType) {
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.7.0-pr-60121-9",
5
+ "version": "5.7.0-pr-60122-16",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [