@typescript-deploys/pr-build 5.4.0-pr-56967-3 → 5.4.0-pr-56908-56

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.4";
21
- var version = `${versionMajorMinor}.0-insiders.20240105`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240108`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -16070,7 +16070,7 @@ function Symbol4(flags, name) {
16070
16070
  this.exportSymbol = void 0;
16071
16071
  this.constEnumOnlyModule = void 0;
16072
16072
  this.isReferenced = void 0;
16073
- this.isAssigned = void 0;
16073
+ this.lastAssignmentPos = void 0;
16074
16074
  this.links = void 0;
16075
16075
  }
16076
16076
  function Type3(checker, flags) {
@@ -17492,13 +17492,6 @@ function hasContextSensitiveParameters(node) {
17492
17492
  function isInfinityOrNaNString(name) {
17493
17493
  return name === "Infinity" || name === "-Infinity" || name === "NaN";
17494
17494
  }
17495
- function isCatchClauseVariableDeclaration(node) {
17496
- return node.kind === 260 /* VariableDeclaration */ && node.parent.kind === 299 /* CatchClause */;
17497
- }
17498
- function isParameterOrCatchClauseVariable(symbol) {
17499
- const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
17500
- return !!declaration && (isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
17501
- }
17502
17495
  function isFunctionExpressionOrArrowFunction(node) {
17503
17496
  return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */;
17504
17497
  }
@@ -66178,7 +66171,7 @@ function createTypeChecker(host) {
66178
66171
  case 80 /* Identifier */:
66179
66172
  if (!isThisInTypeQuery(node)) {
66180
66173
  const symbol = getResolvedSymbol(node);
66181
- return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
66174
+ return isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol);
66182
66175
  }
66183
66176
  break;
66184
66177
  case 211 /* PropertyAccessExpression */:
@@ -67268,10 +67261,17 @@ function createTypeChecker(host) {
67268
67261
  return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
67269
67262
  }
67270
67263
  function isSymbolAssigned(symbol) {
67271
- if (!symbol.valueDeclaration) {
67264
+ return !isPastLastAssignment(
67265
+ symbol,
67266
+ /*location*/
67267
+ void 0
67268
+ );
67269
+ }
67270
+ function isPastLastAssignment(symbol, location) {
67271
+ const parent = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
67272
+ if (!parent) {
67272
67273
  return false;
67273
67274
  }
67274
- const parent = getRootDeclaration(symbol.valueDeclaration).parent;
67275
67275
  const links = getNodeLinks(parent);
67276
67276
  if (!(links.flags & 131072 /* AssignmentsMarked */)) {
67277
67277
  links.flags |= 131072 /* AssignmentsMarked */;
@@ -67279,7 +67279,7 @@ function createTypeChecker(host) {
67279
67279
  markNodeAssignments(parent);
67280
67280
  }
67281
67281
  }
67282
- return symbol.isAssigned || false;
67282
+ return !symbol.lastAssignmentPos || location && symbol.lastAssignmentPos < location.pos;
67283
67283
  }
67284
67284
  function isSomeSymbolAssigned(rootDeclaration) {
67285
67285
  Debug.assert(isVariableDeclaration(rootDeclaration) || isParameter(rootDeclaration));
@@ -67292,23 +67292,81 @@ function createTypeChecker(host) {
67292
67292
  return some(node.elements, (e) => e.kind !== 232 /* OmittedExpression */ && isSomeSymbolAssignedWorker(e.name));
67293
67293
  }
67294
67294
  function hasParentWithAssignmentsMarked(node) {
67295
- return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
67295
+ return !!findAncestor(node.parent, (node2) => isFunctionOrSourceFile(node2) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
67296
+ }
67297
+ function isFunctionOrSourceFile(node) {
67298
+ return isFunctionLikeDeclaration(node) || isSourceFile(node);
67296
67299
  }
67297
67300
  function markNodeAssignments(node) {
67298
- if (node.kind === 80 /* Identifier */) {
67299
- if (isAssignmentTarget(node)) {
67300
- const symbol = getResolvedSymbol(node);
67301
- if (isParameterOrCatchClauseVariable(symbol)) {
67302
- symbol.isAssigned = true;
67301
+ switch (node.kind) {
67302
+ case 80 /* Identifier */:
67303
+ if (isAssignmentTarget(node)) {
67304
+ const symbol = getResolvedSymbol(node);
67305
+ if (isParameterOrMutableLocalVariable(symbol) && symbol.lastAssignmentPos !== Number.MAX_VALUE) {
67306
+ const referencingFunction = findAncestor(node, isFunctionOrSourceFile);
67307
+ const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
67308
+ symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE;
67309
+ }
67303
67310
  }
67311
+ return;
67312
+ case 281 /* ExportSpecifier */:
67313
+ const exportDeclaration = node.parent.parent;
67314
+ if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier) {
67315
+ const symbol = resolveEntityName(
67316
+ node.propertyName || node.name,
67317
+ 111551 /* Value */,
67318
+ /*ignoreErrors*/
67319
+ true,
67320
+ /*dontResolveAlias*/
67321
+ true
67322
+ );
67323
+ if (symbol && isParameterOrMutableLocalVariable(symbol)) {
67324
+ symbol.lastAssignmentPos = Number.MAX_VALUE;
67325
+ }
67326
+ }
67327
+ return;
67328
+ case 264 /* InterfaceDeclaration */:
67329
+ case 265 /* TypeAliasDeclaration */:
67330
+ case 266 /* EnumDeclaration */:
67331
+ return;
67332
+ }
67333
+ if (isTypeNode(node)) {
67334
+ return;
67335
+ }
67336
+ forEachChild(node, markNodeAssignments);
67337
+ }
67338
+ function extendAssignmentPosition(node, declaration) {
67339
+ let pos = node.pos;
67340
+ while (node && node.pos > declaration.pos) {
67341
+ switch (node.kind) {
67342
+ case 243 /* VariableStatement */:
67343
+ case 244 /* ExpressionStatement */:
67344
+ case 245 /* IfStatement */:
67345
+ case 246 /* DoStatement */:
67346
+ case 247 /* WhileStatement */:
67347
+ case 248 /* ForStatement */:
67348
+ case 249 /* ForInStatement */:
67349
+ case 250 /* ForOfStatement */:
67350
+ case 254 /* WithStatement */:
67351
+ case 255 /* SwitchStatement */:
67352
+ case 258 /* TryStatement */:
67353
+ case 263 /* ClassDeclaration */:
67354
+ pos = node.end;
67304
67355
  }
67305
- } else {
67306
- forEachChild(node, markNodeAssignments);
67356
+ node = node.parent;
67307
67357
  }
67358
+ return pos;
67308
67359
  }
67309
67360
  function isConstantVariable(symbol) {
67310
67361
  return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 6 /* Constant */) !== 0;
67311
67362
  }
67363
+ function isParameterOrMutableLocalVariable(symbol) {
67364
+ const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
67365
+ return !!declaration && (isParameter(declaration) || isVariableDeclaration(declaration) && (isCatchClause(declaration.parent) || isMutableLocalVariableDeclaration(declaration)));
67366
+ }
67367
+ function isMutableLocalVariableDeclaration(declaration) {
67368
+ return !!(declaration.parent.flags & 1 /* Let */) && !(getCombinedModifierFlags(declaration) & 32 /* Export */ || declaration.parent.parent.kind === 243 /* VariableStatement */ && isGlobalSourceFile(declaration.parent.parent.parent));
67369
+ }
67312
67370
  function parameterInitializerContainsUndefined(declaration) {
67313
67371
  const links = getNodeLinks(declaration);
67314
67372
  if (links.parameterInitializerContainsUndefined === void 0) {
@@ -67557,7 +67615,7 @@ function createTypeChecker(host) {
67557
67615
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
67558
67616
  const typeIsAutomatic = type === autoType || type === autoArrayType;
67559
67617
  const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
67560
- while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
67618
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) {
67561
67619
  flowContainer = getControlFlowContainer(flowContainer);
67562
67620
  }
67563
67621
  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 */;
package/lib/tsserver.js CHANGED
@@ -1253,7 +1253,6 @@ __export(server_exports, {
1253
1253
  isCaseKeyword: () => isCaseKeyword,
1254
1254
  isCaseOrDefaultClause: () => isCaseOrDefaultClause,
1255
1255
  isCatchClause: () => isCatchClause,
1256
- isCatchClauseVariableDeclaration: () => isCatchClauseVariableDeclaration,
1257
1256
  isCatchClauseVariableDeclarationOrBindingElement: () => isCatchClauseVariableDeclarationOrBindingElement,
1258
1257
  isCheckJsEnabledForFile: () => isCheckJsEnabledForFile,
1259
1258
  isChildOfNodeWithKind: () => isChildOfNodeWithKind,
@@ -1655,7 +1654,6 @@ __export(server_exports, {
1655
1654
  isPackedArrayLiteral: () => isPackedArrayLiteral,
1656
1655
  isParameter: () => isParameter,
1657
1656
  isParameterDeclaration: () => isParameterDeclaration,
1658
- isParameterOrCatchClauseVariable: () => isParameterOrCatchClauseVariable,
1659
1657
  isParameterPropertyDeclaration: () => isParameterPropertyDeclaration,
1660
1658
  isParameterPropertyModifier: () => isParameterPropertyModifier,
1661
1659
  isParenthesizedExpression: () => isParenthesizedExpression,
@@ -2341,7 +2339,7 @@ module.exports = __toCommonJS(server_exports);
2341
2339
 
2342
2340
  // src/compiler/corePublic.ts
2343
2341
  var versionMajorMinor = "5.4";
2344
- var version = `${versionMajorMinor}.0-insiders.20240105`;
2342
+ var version = `${versionMajorMinor}.0-insiders.20240108`;
2345
2343
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2346
2344
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2347
2345
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -20241,7 +20239,7 @@ function Symbol4(flags, name) {
20241
20239
  this.exportSymbol = void 0;
20242
20240
  this.constEnumOnlyModule = void 0;
20243
20241
  this.isReferenced = void 0;
20244
- this.isAssigned = void 0;
20242
+ this.lastAssignmentPos = void 0;
20245
20243
  this.links = void 0;
20246
20244
  }
20247
20245
  function Type3(checker, flags) {
@@ -21713,13 +21711,6 @@ function hasContextSensitiveParameters(node) {
21713
21711
  function isInfinityOrNaNString(name) {
21714
21712
  return name === "Infinity" || name === "-Infinity" || name === "NaN";
21715
21713
  }
21716
- function isCatchClauseVariableDeclaration(node) {
21717
- return node.kind === 260 /* VariableDeclaration */ && node.parent.kind === 299 /* CatchClause */;
21718
- }
21719
- function isParameterOrCatchClauseVariable(symbol) {
21720
- const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
21721
- return !!declaration && (isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
21722
- }
21723
21714
  function isFunctionExpressionOrArrowFunction(node) {
21724
21715
  return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */;
21725
21716
  }
@@ -70917,7 +70908,7 @@ function createTypeChecker(host) {
70917
70908
  case 80 /* Identifier */:
70918
70909
  if (!isThisInTypeQuery(node)) {
70919
70910
  const symbol = getResolvedSymbol(node);
70920
- return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
70911
+ return isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol);
70921
70912
  }
70922
70913
  break;
70923
70914
  case 211 /* PropertyAccessExpression */:
@@ -72007,10 +71998,17 @@ function createTypeChecker(host) {
72007
71998
  return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
72008
71999
  }
72009
72000
  function isSymbolAssigned(symbol) {
72010
- if (!symbol.valueDeclaration) {
72001
+ return !isPastLastAssignment(
72002
+ symbol,
72003
+ /*location*/
72004
+ void 0
72005
+ );
72006
+ }
72007
+ function isPastLastAssignment(symbol, location) {
72008
+ const parent2 = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
72009
+ if (!parent2) {
72011
72010
  return false;
72012
72011
  }
72013
- const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
72014
72012
  const links = getNodeLinks(parent2);
72015
72013
  if (!(links.flags & 131072 /* AssignmentsMarked */)) {
72016
72014
  links.flags |= 131072 /* AssignmentsMarked */;
@@ -72018,7 +72016,7 @@ function createTypeChecker(host) {
72018
72016
  markNodeAssignments(parent2);
72019
72017
  }
72020
72018
  }
72021
- return symbol.isAssigned || false;
72019
+ return !symbol.lastAssignmentPos || location && symbol.lastAssignmentPos < location.pos;
72022
72020
  }
72023
72021
  function isSomeSymbolAssigned(rootDeclaration) {
72024
72022
  Debug.assert(isVariableDeclaration(rootDeclaration) || isParameter(rootDeclaration));
@@ -72031,23 +72029,81 @@ function createTypeChecker(host) {
72031
72029
  return some(node.elements, (e) => e.kind !== 232 /* OmittedExpression */ && isSomeSymbolAssignedWorker(e.name));
72032
72030
  }
72033
72031
  function hasParentWithAssignmentsMarked(node) {
72034
- return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
72032
+ return !!findAncestor(node.parent, (node2) => isFunctionOrSourceFile(node2) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
72033
+ }
72034
+ function isFunctionOrSourceFile(node) {
72035
+ return isFunctionLikeDeclaration(node) || isSourceFile(node);
72035
72036
  }
72036
72037
  function markNodeAssignments(node) {
72037
- if (node.kind === 80 /* Identifier */) {
72038
- if (isAssignmentTarget(node)) {
72039
- const symbol = getResolvedSymbol(node);
72040
- if (isParameterOrCatchClauseVariable(symbol)) {
72041
- symbol.isAssigned = true;
72038
+ switch (node.kind) {
72039
+ case 80 /* Identifier */:
72040
+ if (isAssignmentTarget(node)) {
72041
+ const symbol = getResolvedSymbol(node);
72042
+ if (isParameterOrMutableLocalVariable(symbol) && symbol.lastAssignmentPos !== Number.MAX_VALUE) {
72043
+ const referencingFunction = findAncestor(node, isFunctionOrSourceFile);
72044
+ const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
72045
+ symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE;
72046
+ }
72042
72047
  }
72048
+ return;
72049
+ case 281 /* ExportSpecifier */:
72050
+ const exportDeclaration = node.parent.parent;
72051
+ if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier) {
72052
+ const symbol = resolveEntityName(
72053
+ node.propertyName || node.name,
72054
+ 111551 /* Value */,
72055
+ /*ignoreErrors*/
72056
+ true,
72057
+ /*dontResolveAlias*/
72058
+ true
72059
+ );
72060
+ if (symbol && isParameterOrMutableLocalVariable(symbol)) {
72061
+ symbol.lastAssignmentPos = Number.MAX_VALUE;
72062
+ }
72063
+ }
72064
+ return;
72065
+ case 264 /* InterfaceDeclaration */:
72066
+ case 265 /* TypeAliasDeclaration */:
72067
+ case 266 /* EnumDeclaration */:
72068
+ return;
72069
+ }
72070
+ if (isTypeNode(node)) {
72071
+ return;
72072
+ }
72073
+ forEachChild(node, markNodeAssignments);
72074
+ }
72075
+ function extendAssignmentPosition(node, declaration) {
72076
+ let pos = node.pos;
72077
+ while (node && node.pos > declaration.pos) {
72078
+ switch (node.kind) {
72079
+ case 243 /* VariableStatement */:
72080
+ case 244 /* ExpressionStatement */:
72081
+ case 245 /* IfStatement */:
72082
+ case 246 /* DoStatement */:
72083
+ case 247 /* WhileStatement */:
72084
+ case 248 /* ForStatement */:
72085
+ case 249 /* ForInStatement */:
72086
+ case 250 /* ForOfStatement */:
72087
+ case 254 /* WithStatement */:
72088
+ case 255 /* SwitchStatement */:
72089
+ case 258 /* TryStatement */:
72090
+ case 263 /* ClassDeclaration */:
72091
+ pos = node.end;
72043
72092
  }
72044
- } else {
72045
- forEachChild(node, markNodeAssignments);
72093
+ node = node.parent;
72046
72094
  }
72095
+ return pos;
72047
72096
  }
72048
72097
  function isConstantVariable(symbol) {
72049
72098
  return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 6 /* Constant */) !== 0;
72050
72099
  }
72100
+ function isParameterOrMutableLocalVariable(symbol) {
72101
+ const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
72102
+ return !!declaration && (isParameter(declaration) || isVariableDeclaration(declaration) && (isCatchClause(declaration.parent) || isMutableLocalVariableDeclaration(declaration)));
72103
+ }
72104
+ function isMutableLocalVariableDeclaration(declaration) {
72105
+ return !!(declaration.parent.flags & 1 /* Let */) && !(getCombinedModifierFlags(declaration) & 32 /* Export */ || declaration.parent.parent.kind === 243 /* VariableStatement */ && isGlobalSourceFile(declaration.parent.parent.parent));
72106
+ }
72051
72107
  function parameterInitializerContainsUndefined(declaration) {
72052
72108
  const links = getNodeLinks(declaration);
72053
72109
  if (links.parameterInitializerContainsUndefined === void 0) {
@@ -72296,7 +72352,7 @@ function createTypeChecker(host) {
72296
72352
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
72297
72353
  const typeIsAutomatic = type === autoType || type === autoArrayType;
72298
72354
  const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
72299
- while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
72355
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) {
72300
72356
  flowContainer = getControlFlowContainer(flowContainer);
72301
72357
  }
72302
72358
  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 */;
@@ -175082,7 +175138,6 @@ __export(ts_exports2, {
175082
175138
  isCaseKeyword: () => isCaseKeyword,
175083
175139
  isCaseOrDefaultClause: () => isCaseOrDefaultClause,
175084
175140
  isCatchClause: () => isCatchClause,
175085
- isCatchClauseVariableDeclaration: () => isCatchClauseVariableDeclaration,
175086
175141
  isCatchClauseVariableDeclarationOrBindingElement: () => isCatchClauseVariableDeclarationOrBindingElement,
175087
175142
  isCheckJsEnabledForFile: () => isCheckJsEnabledForFile,
175088
175143
  isChildOfNodeWithKind: () => isChildOfNodeWithKind,
@@ -175484,7 +175539,6 @@ __export(ts_exports2, {
175484
175539
  isPackedArrayLiteral: () => isPackedArrayLiteral,
175485
175540
  isParameter: () => isParameter,
175486
175541
  isParameterDeclaration: () => isParameterDeclaration,
175487
- isParameterOrCatchClauseVariable: () => isParameterOrCatchClauseVariable,
175488
175542
  isParameterPropertyDeclaration: () => isParameterPropertyDeclaration,
175489
175543
  isParameterPropertyModifier: () => isParameterPropertyModifier,
175490
175544
  isParenthesizedExpression: () => isParenthesizedExpression,
@@ -189883,7 +189937,6 @@ start(initializeNodeSystem(), require("os").platform());
189883
189937
  isCaseKeyword,
189884
189938
  isCaseOrDefaultClause,
189885
189939
  isCatchClause,
189886
- isCatchClauseVariableDeclaration,
189887
189940
  isCatchClauseVariableDeclarationOrBindingElement,
189888
189941
  isCheckJsEnabledForFile,
189889
189942
  isChildOfNodeWithKind,
@@ -190285,7 +190338,6 @@ start(initializeNodeSystem(), require("os").platform());
190285
190338
  isPackedArrayLiteral,
190286
190339
  isParameter,
190287
190340
  isParameterDeclaration,
190288
- isParameterOrCatchClauseVariable,
190289
190341
  isParameterPropertyDeclaration,
190290
190342
  isParameterPropertyModifier,
190291
190343
  isParenthesizedExpression,
@@ -6021,19 +6021,10 @@ declare namespace ts {
6021
6021
  /** @deprecated */
6022
6022
  type AssertionKey = ImportAttributeName;
6023
6023
  /** @deprecated */
6024
- interface AssertEntry extends Node {
6025
- readonly kind: SyntaxKind.AssertEntry;
6026
- readonly parent: AssertClause;
6027
- readonly name: ImportAttributeName;
6028
- readonly value: Expression;
6024
+ interface AssertEntry extends ImportAttribute {
6029
6025
  }
6030
6026
  /** @deprecated */
6031
- interface AssertClause extends Node {
6032
- readonly token: SyntaxKind.WithKeyword | SyntaxKind.AssertKeyword;
6033
- readonly kind: SyntaxKind.AssertClause;
6034
- readonly parent: ImportDeclaration | ExportDeclaration;
6035
- readonly elements: NodeArray<AssertEntry>;
6036
- readonly multiLine?: boolean;
6027
+ interface AssertClause extends ImportAttributes {
6037
6028
  }
6038
6029
  type ImportAttributeName = Identifier | StringLiteral;
6039
6030
  interface ImportAttribute extends Node {
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.4";
38
- version = `${versionMajorMinor}.0-insiders.20240105`;
38
+ version = `${versionMajorMinor}.0-insiders.20240108`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -17529,7 +17529,7 @@ ${lanes.join("\n")}
17529
17529
  this.exportSymbol = void 0;
17530
17530
  this.constEnumOnlyModule = void 0;
17531
17531
  this.isReferenced = void 0;
17532
- this.isAssigned = void 0;
17532
+ this.lastAssignmentPos = void 0;
17533
17533
  this.links = void 0;
17534
17534
  }
17535
17535
  function Type3(checker, flags) {
@@ -18708,13 +18708,6 @@ ${lanes.join("\n")}
18708
18708
  function isInfinityOrNaNString(name) {
18709
18709
  return name === "Infinity" || name === "-Infinity" || name === "NaN";
18710
18710
  }
18711
- function isCatchClauseVariableDeclaration(node) {
18712
- return node.kind === 260 /* VariableDeclaration */ && node.parent.kind === 299 /* CatchClause */;
18713
- }
18714
- function isParameterOrCatchClauseVariable(symbol) {
18715
- const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
18716
- return !!declaration && (isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
18717
- }
18718
18711
  function isFunctionExpressionOrArrowFunction(node) {
18719
18712
  return node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */;
18720
18713
  }
@@ -68671,7 +68664,7 @@ ${lanes.join("\n")}
68671
68664
  case 80 /* Identifier */:
68672
68665
  if (!isThisInTypeQuery(node)) {
68673
68666
  const symbol = getResolvedSymbol(node);
68674
- return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
68667
+ return isConstantVariable(symbol) || isParameterOrMutableLocalVariable(symbol) && !isSymbolAssigned(symbol);
68675
68668
  }
68676
68669
  break;
68677
68670
  case 211 /* PropertyAccessExpression */:
@@ -69761,10 +69754,17 @@ ${lanes.join("\n")}
69761
69754
  return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
69762
69755
  }
69763
69756
  function isSymbolAssigned(symbol) {
69764
- if (!symbol.valueDeclaration) {
69757
+ return !isPastLastAssignment(
69758
+ symbol,
69759
+ /*location*/
69760
+ void 0
69761
+ );
69762
+ }
69763
+ function isPastLastAssignment(symbol, location) {
69764
+ const parent2 = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
69765
+ if (!parent2) {
69765
69766
  return false;
69766
69767
  }
69767
- const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
69768
69768
  const links = getNodeLinks(parent2);
69769
69769
  if (!(links.flags & 131072 /* AssignmentsMarked */)) {
69770
69770
  links.flags |= 131072 /* AssignmentsMarked */;
@@ -69772,7 +69772,7 @@ ${lanes.join("\n")}
69772
69772
  markNodeAssignments(parent2);
69773
69773
  }
69774
69774
  }
69775
- return symbol.isAssigned || false;
69775
+ return !symbol.lastAssignmentPos || location && symbol.lastAssignmentPos < location.pos;
69776
69776
  }
69777
69777
  function isSomeSymbolAssigned(rootDeclaration) {
69778
69778
  Debug.assert(isVariableDeclaration(rootDeclaration) || isParameter(rootDeclaration));
@@ -69785,23 +69785,81 @@ ${lanes.join("\n")}
69785
69785
  return some(node.elements, (e) => e.kind !== 232 /* OmittedExpression */ && isSomeSymbolAssignedWorker(e.name));
69786
69786
  }
69787
69787
  function hasParentWithAssignmentsMarked(node) {
69788
- return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
69788
+ return !!findAncestor(node.parent, (node2) => isFunctionOrSourceFile(node2) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
69789
+ }
69790
+ function isFunctionOrSourceFile(node) {
69791
+ return isFunctionLikeDeclaration(node) || isSourceFile(node);
69789
69792
  }
69790
69793
  function markNodeAssignments(node) {
69791
- if (node.kind === 80 /* Identifier */) {
69792
- if (isAssignmentTarget(node)) {
69793
- const symbol = getResolvedSymbol(node);
69794
- if (isParameterOrCatchClauseVariable(symbol)) {
69795
- symbol.isAssigned = true;
69794
+ switch (node.kind) {
69795
+ case 80 /* Identifier */:
69796
+ if (isAssignmentTarget(node)) {
69797
+ const symbol = getResolvedSymbol(node);
69798
+ if (isParameterOrMutableLocalVariable(symbol) && symbol.lastAssignmentPos !== Number.MAX_VALUE) {
69799
+ const referencingFunction = findAncestor(node, isFunctionOrSourceFile);
69800
+ const declaringFunction = findAncestor(symbol.valueDeclaration, isFunctionOrSourceFile);
69801
+ symbol.lastAssignmentPos = referencingFunction === declaringFunction ? extendAssignmentPosition(node, symbol.valueDeclaration) : Number.MAX_VALUE;
69802
+ }
69796
69803
  }
69804
+ return;
69805
+ case 281 /* ExportSpecifier */:
69806
+ const exportDeclaration = node.parent.parent;
69807
+ if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier) {
69808
+ const symbol = resolveEntityName(
69809
+ node.propertyName || node.name,
69810
+ 111551 /* Value */,
69811
+ /*ignoreErrors*/
69812
+ true,
69813
+ /*dontResolveAlias*/
69814
+ true
69815
+ );
69816
+ if (symbol && isParameterOrMutableLocalVariable(symbol)) {
69817
+ symbol.lastAssignmentPos = Number.MAX_VALUE;
69818
+ }
69819
+ }
69820
+ return;
69821
+ case 264 /* InterfaceDeclaration */:
69822
+ case 265 /* TypeAliasDeclaration */:
69823
+ case 266 /* EnumDeclaration */:
69824
+ return;
69825
+ }
69826
+ if (isTypeNode(node)) {
69827
+ return;
69828
+ }
69829
+ forEachChild(node, markNodeAssignments);
69830
+ }
69831
+ function extendAssignmentPosition(node, declaration) {
69832
+ let pos = node.pos;
69833
+ while (node && node.pos > declaration.pos) {
69834
+ switch (node.kind) {
69835
+ case 243 /* VariableStatement */:
69836
+ case 244 /* ExpressionStatement */:
69837
+ case 245 /* IfStatement */:
69838
+ case 246 /* DoStatement */:
69839
+ case 247 /* WhileStatement */:
69840
+ case 248 /* ForStatement */:
69841
+ case 249 /* ForInStatement */:
69842
+ case 250 /* ForOfStatement */:
69843
+ case 254 /* WithStatement */:
69844
+ case 255 /* SwitchStatement */:
69845
+ case 258 /* TryStatement */:
69846
+ case 263 /* ClassDeclaration */:
69847
+ pos = node.end;
69797
69848
  }
69798
- } else {
69799
- forEachChild(node, markNodeAssignments);
69849
+ node = node.parent;
69800
69850
  }
69851
+ return pos;
69801
69852
  }
69802
69853
  function isConstantVariable(symbol) {
69803
69854
  return symbol.flags & 3 /* Variable */ && (getDeclarationNodeFlagsFromSymbol(symbol) & 6 /* Constant */) !== 0;
69804
69855
  }
69856
+ function isParameterOrMutableLocalVariable(symbol) {
69857
+ const declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
69858
+ return !!declaration && (isParameter(declaration) || isVariableDeclaration(declaration) && (isCatchClause(declaration.parent) || isMutableLocalVariableDeclaration(declaration)));
69859
+ }
69860
+ function isMutableLocalVariableDeclaration(declaration) {
69861
+ return !!(declaration.parent.flags & 1 /* Let */) && !(getCombinedModifierFlags(declaration) & 32 /* Export */ || declaration.parent.parent.kind === 243 /* VariableStatement */ && isGlobalSourceFile(declaration.parent.parent.parent));
69862
+ }
69805
69863
  function parameterInitializerContainsUndefined(declaration) {
69806
69864
  const links = getNodeLinks(declaration);
69807
69865
  if (links.parameterInitializerContainsUndefined === void 0) {
@@ -70050,7 +70108,7 @@ ${lanes.join("\n")}
70050
70108
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
70051
70109
  const typeIsAutomatic = type === autoType || type === autoArrayType;
70052
70110
  const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
70053
- while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
70111
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameterOrMutableLocalVariable(localOrExportSymbol) && isPastLastAssignment(localOrExportSymbol, node))) {
70054
70112
  flowContainer = getControlFlowContainer(flowContainer);
70055
70113
  }
70056
70114
  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 */;
@@ -186631,7 +186689,6 @@ ${e.message}`;
186631
186689
  isCaseKeyword: () => isCaseKeyword,
186632
186690
  isCaseOrDefaultClause: () => isCaseOrDefaultClause,
186633
186691
  isCatchClause: () => isCatchClause,
186634
- isCatchClauseVariableDeclaration: () => isCatchClauseVariableDeclaration,
186635
186692
  isCatchClauseVariableDeclarationOrBindingElement: () => isCatchClauseVariableDeclarationOrBindingElement,
186636
186693
  isCheckJsEnabledForFile: () => isCheckJsEnabledForFile,
186637
186694
  isChildOfNodeWithKind: () => isChildOfNodeWithKind,
@@ -187033,7 +187090,6 @@ ${e.message}`;
187033
187090
  isPackedArrayLiteral: () => isPackedArrayLiteral,
187034
187091
  isParameter: () => isParameter,
187035
187092
  isParameterDeclaration: () => isParameterDeclaration,
187036
- isParameterOrCatchClauseVariable: () => isParameterOrCatchClauseVariable,
187037
187093
  isParameterPropertyDeclaration: () => isParameterPropertyDeclaration,
187038
187094
  isParameterPropertyModifier: () => isParameterPropertyModifier,
187039
187095
  isParenthesizedExpression: () => isParenthesizedExpression,
@@ -189053,7 +189109,6 @@ ${e.message}`;
189053
189109
  isCaseKeyword: () => isCaseKeyword,
189054
189110
  isCaseOrDefaultClause: () => isCaseOrDefaultClause,
189055
189111
  isCatchClause: () => isCatchClause,
189056
- isCatchClauseVariableDeclaration: () => isCatchClauseVariableDeclaration,
189057
189112
  isCatchClauseVariableDeclarationOrBindingElement: () => isCatchClauseVariableDeclarationOrBindingElement,
189058
189113
  isCheckJsEnabledForFile: () => isCheckJsEnabledForFile,
189059
189114
  isChildOfNodeWithKind: () => isChildOfNodeWithKind,
@@ -189455,7 +189510,6 @@ ${e.message}`;
189455
189510
  isPackedArrayLiteral: () => isPackedArrayLiteral,
189456
189511
  isParameter: () => isParameter,
189457
189512
  isParameterDeclaration: () => isParameterDeclaration,
189458
- isParameterOrCatchClauseVariable: () => isParameterOrCatchClauseVariable,
189459
189513
  isParameterPropertyDeclaration: () => isParameterPropertyDeclaration,
189460
189514
  isParameterPropertyModifier: () => isParameterPropertyModifier,
189461
189515
  isParenthesizedExpression: () => isParenthesizedExpression,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.4";
57
- var version = `${versionMajorMinor}.0-insiders.20240105`;
57
+ var version = `${versionMajorMinor}.0-insiders.20240108`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -11129,7 +11129,7 @@ function Symbol4(flags, name) {
11129
11129
  this.exportSymbol = void 0;
11130
11130
  this.constEnumOnlyModule = void 0;
11131
11131
  this.isReferenced = void 0;
11132
- this.isAssigned = void 0;
11132
+ this.lastAssignmentPos = void 0;
11133
11133
  this.links = void 0;
11134
11134
  }
11135
11135
  function Type3(checker, flags) {
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.4.0-pr-56967-3",
5
+ "version": "5.4.0-pr-56908-56",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "20.1.0",
115
115
  "npm": "8.19.4"
116
116
  },
117
- "gitHead": "dc51ab57d755d1bb5f700d7d8eb3ba1f04c33bc5"
117
+ "gitHead": "11c87792dfbf34305c9e0e98914e57d2b4465504"
118
118
  }