@typescript-deploys/pr-build 5.6.0-pr-59689-2 → 5.6.0-pr-55887-76

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
@@ -17134,6 +17134,9 @@ function accessKind(node) {
17134
17134
  return node === parent.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent.parent);
17135
17135
  case 209 /* ArrayLiteralExpression */:
17136
17136
  return accessKind(parent);
17137
+ case 249 /* ForInStatement */:
17138
+ case 250 /* ForOfStatement */:
17139
+ return node === parent.initializer ? 1 /* Write */ : 0 /* Read */;
17137
17140
  default:
17138
17141
  return 0 /* Read */;
17139
17142
  }
@@ -69774,6 +69777,12 @@ function createTypeChecker(host) {
69774
69777
  function getControlFlowContainer(node) {
69775
69778
  return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 307 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
69776
69779
  }
69780
+ function isSymbolAssignedDefinitely(symbol) {
69781
+ if (symbol.lastAssignmentPos !== void 0) {
69782
+ return symbol.lastAssignmentPos < 0;
69783
+ }
69784
+ return isSymbolAssigned(symbol) && symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0;
69785
+ }
69777
69786
  function isSymbolAssigned(symbol) {
69778
69787
  return !isPastLastAssignment(
69779
69788
  symbol,
@@ -69793,7 +69802,7 @@ function createTypeChecker(host) {
69793
69802
  markNodeAssignments(parent);
69794
69803
  }
69795
69804
  }
69796
- return !symbol.lastAssignmentPos || location && symbol.lastAssignmentPos < location.pos;
69805
+ return !symbol.lastAssignmentPos || location && Math.abs(symbol.lastAssignmentPos) < location.pos;
69797
69806
  }
69798
69807
  function isSomeSymbolAssigned(rootDeclaration) {
69799
69808
  Debug.assert(isVariableDeclaration(rootDeclaration) || isParameter(rootDeclaration));
@@ -69814,12 +69823,19 @@ function createTypeChecker(host) {
69814
69823
  function markNodeAssignments(node) {
69815
69824
  switch (node.kind) {
69816
69825
  case 80 /* Identifier */:
69817
- if (isAssignmentTarget(node)) {
69826
+ const assigmentTarget = getAssignmentTargetKind(node);
69827
+ if (assigmentTarget !== 0 /* None */) {
69818
69828
  const symbol = getResolvedSymbol(node);
69819
- if (isParameterOrMutableLocalVariable(symbol) && symbol.lastAssignmentPos !== Number.MAX_VALUE) {
69820
- const referencingFunction = findAncestor(node, isFunctionOrSourceFile);
69821
- const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
69822
- symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE;
69829
+ const hasDefiniteAssignment = assigmentTarget === 1 /* Definite */ || symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0;
69830
+ if (isParameterOrMutableLocalVariable(symbol)) {
69831
+ if (symbol.lastAssignmentPos === void 0 || Math.abs(symbol.lastAssignmentPos) !== Number.MAX_VALUE) {
69832
+ const referencingFunction = findAncestor(node, isFunctionOrSourceFile);
69833
+ const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
69834
+ symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE;
69835
+ }
69836
+ if (hasDefiniteAssignment && symbol.lastAssignmentPos > 0) {
69837
+ symbol.lastAssignmentPos = -symbol.lastAssignmentPos;
69838
+ }
69823
69839
  }
69824
69840
  }
69825
69841
  return;
@@ -69836,7 +69852,8 @@ function createTypeChecker(host) {
69836
69852
  true
69837
69853
  );
69838
69854
  if (symbol && isParameterOrMutableLocalVariable(symbol)) {
69839
- symbol.lastAssignmentPos = Number.MAX_VALUE;
69855
+ const sign = symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0 ? -1 : 1;
69856
+ symbol.lastAssignmentPos = sign * Number.MAX_VALUE;
69840
69857
  }
69841
69858
  }
69842
69859
  return;
@@ -70420,6 +70437,7 @@ function createTypeChecker(host) {
70420
70437
  }
70421
70438
  const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
70422
70439
  let declaration = localOrExportSymbol.valueDeclaration;
70440
+ const immediateDeclaration = declaration;
70423
70441
  if (declaration && declaration.kind === 208 /* BindingElement */ && contains(contextualBindingPatterns, declaration.parent) && findAncestor(node, (parent) => parent === declaration.parent)) {
70424
70442
  return nonInferrableAnyType;
70425
70443
  }
@@ -70465,7 +70483,8 @@ function createTypeChecker(host) {
70465
70483
  while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) {
70466
70484
  flowContainer = getControlFlowContainer(flowContainer);
70467
70485
  }
70468
- const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
70486
+ const isNeverInitialized = immediateDeclaration && isVariableDeclaration(immediateDeclaration) && !immediateDeclaration.initializer && !immediateDeclaration.exclamationToken && isMutableLocalVariableDeclaration(immediateDeclaration) && !isSymbolAssignedDefinitely(symbol);
70487
+ const assumeInitialized = isParameter2 || isAlias || isOuterVariable && !isNeverInitialized || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
70469
70488
  const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type);
70470
70489
  const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer);
70471
70490
  if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
package/lib/typescript.js CHANGED
@@ -21026,6 +21026,9 @@ function accessKind(node) {
21026
21026
  return node === parent2.objectAssignmentInitializer ? 0 /* Read */ : accessKind(parent2.parent);
21027
21027
  case 209 /* ArrayLiteralExpression */:
21028
21028
  return accessKind(parent2);
21029
+ case 249 /* ForInStatement */:
21030
+ case 250 /* ForOfStatement */:
21031
+ return node === parent2.initializer ? 1 /* Write */ : 0 /* Read */;
21029
21032
  default:
21030
21033
  return 0 /* Read */;
21031
21034
  }
@@ -74394,6 +74397,12 @@ function createTypeChecker(host) {
74394
74397
  function getControlFlowContainer(node) {
74395
74398
  return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 307 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
74396
74399
  }
74400
+ function isSymbolAssignedDefinitely(symbol) {
74401
+ if (symbol.lastAssignmentPos !== void 0) {
74402
+ return symbol.lastAssignmentPos < 0;
74403
+ }
74404
+ return isSymbolAssigned(symbol) && symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0;
74405
+ }
74397
74406
  function isSymbolAssigned(symbol) {
74398
74407
  return !isPastLastAssignment(
74399
74408
  symbol,
@@ -74413,7 +74422,7 @@ function createTypeChecker(host) {
74413
74422
  markNodeAssignments(parent2);
74414
74423
  }
74415
74424
  }
74416
- return !symbol.lastAssignmentPos || location && symbol.lastAssignmentPos < location.pos;
74425
+ return !symbol.lastAssignmentPos || location && Math.abs(symbol.lastAssignmentPos) < location.pos;
74417
74426
  }
74418
74427
  function isSomeSymbolAssigned(rootDeclaration) {
74419
74428
  Debug.assert(isVariableDeclaration(rootDeclaration) || isParameter(rootDeclaration));
@@ -74434,12 +74443,19 @@ function createTypeChecker(host) {
74434
74443
  function markNodeAssignments(node) {
74435
74444
  switch (node.kind) {
74436
74445
  case 80 /* Identifier */:
74437
- if (isAssignmentTarget(node)) {
74446
+ const assigmentTarget = getAssignmentTargetKind(node);
74447
+ if (assigmentTarget !== 0 /* None */) {
74438
74448
  const symbol = getResolvedSymbol(node);
74439
- if (isParameterOrMutableLocalVariable(symbol) && symbol.lastAssignmentPos !== Number.MAX_VALUE) {
74440
- const referencingFunction = findAncestor(node, isFunctionOrSourceFile);
74441
- const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
74442
- symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE;
74449
+ const hasDefiniteAssignment = assigmentTarget === 1 /* Definite */ || symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0;
74450
+ if (isParameterOrMutableLocalVariable(symbol)) {
74451
+ if (symbol.lastAssignmentPos === void 0 || Math.abs(symbol.lastAssignmentPos) !== Number.MAX_VALUE) {
74452
+ const referencingFunction = findAncestor(node, isFunctionOrSourceFile);
74453
+ const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
74454
+ symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE;
74455
+ }
74456
+ if (hasDefiniteAssignment && symbol.lastAssignmentPos > 0) {
74457
+ symbol.lastAssignmentPos = -symbol.lastAssignmentPos;
74458
+ }
74443
74459
  }
74444
74460
  }
74445
74461
  return;
@@ -74456,7 +74472,8 @@ function createTypeChecker(host) {
74456
74472
  true
74457
74473
  );
74458
74474
  if (symbol && isParameterOrMutableLocalVariable(symbol)) {
74459
- symbol.lastAssignmentPos = Number.MAX_VALUE;
74475
+ const sign = symbol.lastAssignmentPos !== void 0 && symbol.lastAssignmentPos < 0 ? -1 : 1;
74476
+ symbol.lastAssignmentPos = sign * Number.MAX_VALUE;
74460
74477
  }
74461
74478
  }
74462
74479
  return;
@@ -75040,6 +75057,7 @@ function createTypeChecker(host) {
75040
75057
  }
75041
75058
  const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
75042
75059
  let declaration = localOrExportSymbol.valueDeclaration;
75060
+ const immediateDeclaration = declaration;
75043
75061
  if (declaration && declaration.kind === 208 /* BindingElement */ && contains(contextualBindingPatterns, declaration.parent) && findAncestor(node, (parent2) => parent2 === declaration.parent)) {
75044
75062
  return nonInferrableAnyType;
75045
75063
  }
@@ -75085,7 +75103,8 @@ function createTypeChecker(host) {
75085
75103
  while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) {
75086
75104
  flowContainer = getControlFlowContainer(flowContainer);
75087
75105
  }
75088
- const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
75106
+ const isNeverInitialized = immediateDeclaration && isVariableDeclaration(immediateDeclaration) && !immediateDeclaration.initializer && !immediateDeclaration.exclamationToken && isMutableLocalVariableDeclaration(immediateDeclaration) && !isSymbolAssignedDefinitely(symbol);
75107
+ const assumeInitialized = isParameter2 || isAlias || isOuterVariable && !isNeverInitialized || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
75089
75108
  const initialType = isAutomaticTypeInNonNull ? undefinedType : assumeInitialized ? isParameter2 ? removeOptionalityFromDeclaredType(type, declaration) : type : typeIsAutomatic ? undefinedType : getOptionalType(type);
75090
75109
  const flowType = isAutomaticTypeInNonNull ? getNonNullableType(getFlowTypeOfReference(node, type, initialType, flowContainer)) : getFlowTypeOfReference(node, type, initialType, flowContainer);
75091
75110
  if (!isEvolvingArrayOperationTarget(node) && (type === autoType || type === autoArrayType)) {
@@ -188748,7 +188767,6 @@ Dynamic files must always be opened with service's current directory or service
188748
188767
  }
188749
188768
  };
188750
188769
  toRetainConfiguredProjects == null ? void 0 : toRetainConfiguredProjects.forEach(retainConfiguredProject);
188751
- if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
188752
188770
  this.inferredProjects.forEach(markOriginalProjectsAsUsed);
188753
188771
  this.externalProjects.forEach(markOriginalProjectsAsUsed);
188754
188772
  this.externalProjectToConfiguredProjectMap.forEach((projects, externalProjectName) => {
@@ -188756,8 +188774,7 @@ Dynamic files must always be opened with service's current directory or service
188756
188774
  projects.forEach(retainConfiguredProject);
188757
188775
  }
188758
188776
  });
188759
- if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
188760
- forEachEntry(this.openFiles, (_projectRootPath, path) => {
188777
+ this.openFiles.forEach((_projectRootPath, path) => {
188761
188778
  if (openFilesWithRetainedConfiguredProject == null ? void 0 : openFilesWithRetainedConfiguredProject.has(path)) return;
188762
188779
  const info = this.getScriptInfoForPath(path);
188763
188780
  if (find(info.containingProjects, isExternalProject)) return;
@@ -188767,15 +188784,12 @@ Dynamic files must always be opened with service's current directory or service
188767
188784
  );
188768
188785
  if (result == null ? void 0 : result.defaultProject) {
188769
188786
  result == null ? void 0 : result.seenProjects.forEach(retainConfiguredProject);
188770
- if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
188771
188787
  }
188772
188788
  });
188773
- if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
188774
- forEachEntry(this.configuredProjects, (project) => {
188789
+ this.configuredProjects.forEach((project) => {
188775
188790
  if (toRemoveConfiguredProjects.has(project)) {
188776
188791
  if (isPendingUpdate(project) || forEachReferencedProject(project, isRetained)) {
188777
188792
  retainConfiguredProject(project);
188778
- if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
188779
188793
  }
188780
188794
  }
188781
188795
  });
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.6.0-pr-59689-2",
5
+ "version": "5.6.0-pr-55887-76",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [