@typescript-deploys/pr-build 5.2.0-pr-52493-8 → 5.2.0-pr-54795-7

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
@@ -13287,8 +13287,8 @@ function isInExpressionContext(node) {
13287
13287
  return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
13288
13288
  case 249 /* ForInStatement */:
13289
13289
  case 250 /* ForOfStatement */:
13290
- const forInOrOfStatement = parent;
13291
- return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node;
13290
+ const forInStatement = parent;
13291
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInStatement.expression === node;
13292
13292
  case 216 /* TypeAssertionExpression */:
13293
13293
  case 234 /* AsExpression */:
13294
13294
  return node === parent.expression;
@@ -13949,23 +13949,20 @@ function getTypeParameterFromJsDoc(node) {
13949
13949
  const { typeParameters } = node.parent.parent.parent;
13950
13950
  return typeParameters && find(typeParameters, (p) => p.name.escapedText === name);
13951
13951
  }
13952
- function getAssignmentTarget(node) {
13952
+ function getAssignmentTargetKind(node) {
13953
13953
  let parent = node.parent;
13954
13954
  while (true) {
13955
13955
  switch (parent.kind) {
13956
13956
  case 226 /* BinaryExpression */:
13957
- const binaryExpression = parent;
13958
- const binaryOperator = binaryExpression.operatorToken.kind;
13959
- return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0;
13957
+ const binaryOperator = parent.operatorToken.kind;
13958
+ return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
13960
13959
  case 224 /* PrefixUnaryExpression */:
13961
13960
  case 225 /* PostfixUnaryExpression */:
13962
- const unaryExpression = parent;
13963
- const unaryOperator = unaryExpression.operator;
13964
- return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0;
13961
+ const unaryOperator = parent.operator;
13962
+ return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
13965
13963
  case 249 /* ForInStatement */:
13966
13964
  case 250 /* ForOfStatement */:
13967
- const forInOrOfStatement = parent;
13968
- return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0;
13965
+ return parent.initializer === node ? 1 /* Definite */ : 0 /* None */;
13969
13966
  case 217 /* ParenthesizedExpression */:
13970
13967
  case 209 /* ArrayLiteralExpression */:
13971
13968
  case 230 /* SpreadElement */:
@@ -13977,53 +13974,24 @@ function getAssignmentTarget(node) {
13977
13974
  break;
13978
13975
  case 304 /* ShorthandPropertyAssignment */:
13979
13976
  if (parent.name !== node) {
13980
- return void 0;
13977
+ return 0 /* None */;
13981
13978
  }
13982
13979
  node = parent.parent;
13983
13980
  break;
13984
13981
  case 303 /* PropertyAssignment */:
13985
13982
  if (parent.name === node) {
13986
- return void 0;
13983
+ return 0 /* None */;
13987
13984
  }
13988
13985
  node = parent.parent;
13989
13986
  break;
13990
13987
  default:
13991
- return void 0;
13988
+ return 0 /* None */;
13992
13989
  }
13993
13990
  parent = node.parent;
13994
13991
  }
13995
13992
  }
13996
- function getAssignmentTargetKind(node) {
13997
- const target = getAssignmentTarget(node);
13998
- if (!target) {
13999
- return 0 /* None */;
14000
- }
14001
- switch (target.kind) {
14002
- case 226 /* BinaryExpression */:
14003
- const binaryOperator = target.operatorToken.kind;
14004
- return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */;
14005
- case 224 /* PrefixUnaryExpression */:
14006
- case 225 /* PostfixUnaryExpression */:
14007
- return 2 /* Compound */;
14008
- case 249 /* ForInStatement */:
14009
- case 250 /* ForOfStatement */:
14010
- return 1 /* Definite */;
14011
- }
14012
- }
14013
13993
  function isAssignmentTarget(node) {
14014
- return !!getAssignmentTarget(node);
14015
- }
14016
- function isCompoundLikeAssignment(assignment) {
14017
- const right = skipParentheses(assignment.right);
14018
- return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind);
14019
- }
14020
- function isInCompoundLikeAssignment(node) {
14021
- const target = getAssignmentTarget(node);
14022
- return !!target && isAssignmentExpression(
14023
- target,
14024
- /*excludeCompoundAssignment*/
14025
- true
14026
- ) && isCompoundLikeAssignment(target);
13994
+ return getAssignmentTargetKind(node) !== 0 /* None */;
14027
13995
  }
14028
13996
  function isNodeWithPossibleHoistedDeclaration(node) {
14029
13997
  switch (node.kind) {
@@ -65203,11 +65171,10 @@ function createTypeChecker(host) {
65203
65171
  const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));
65204
65172
  return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
65205
65173
  }
65206
- const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType;
65207
- if (t.flags & 1048576 /* Union */) {
65208
- return getAssignmentReducedType(t, getInitialOrAssignedType(flow));
65174
+ if (declaredType.flags & 1048576 /* Union */) {
65175
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow));
65209
65176
  }
65210
- return t;
65177
+ return declaredType;
65211
65178
  }
65212
65179
  if (containsMatchingReference(reference, node)) {
65213
65180
  if (!isReachableFlowNode(flow)) {
@@ -65634,14 +65601,12 @@ function createTypeChecker(host) {
65634
65601
  return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
65635
65602
  }
65636
65603
  const target = getReferenceCandidate(expr.right);
65637
- const leftType = getTypeOfExpression(expr.left);
65638
- if (leftType.flags & 8576 /* StringOrNumberLiteralOrUnique */) {
65639
- if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target) && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
65640
- return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
65641
- }
65642
- if (isMatchingReference(reference, target)) {
65643
- return narrowTypeByInKeyword(type, leftType, assumeTrue);
65644
- }
65604
+ let leftType;
65605
+ if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target) && (leftType = getTypeOfExpression(expr.left)).flags & 8576 /* StringOrNumberLiteralOrUnique */ && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
65606
+ return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
65607
+ }
65608
+ if (isMatchingReference(reference, target) && (leftType = getTypeOfExpression(expr.left)).flags & 8576 /* StringOrNumberLiteralOrUnique */) {
65609
+ return narrowTypeByInKeyword(type, leftType, assumeTrue);
65645
65610
  }
65646
65611
  break;
65647
65612
  case 28 /* CommaToken */:
@@ -66336,7 +66301,7 @@ function createTypeChecker(host) {
66336
66301
  const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;
66337
66302
  if (localOrExportSymbol.flags & 3 /* Variable */) {
66338
66303
  if (assignmentKind === 1 /* Definite */) {
66339
- return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type;
66304
+ return type;
66340
66305
  }
66341
66306
  } else if (isAlias) {
66342
66307
  declaration = getDeclarationOfAliasSymbol(symbol);
package/lib/tsserver.js CHANGED
@@ -1414,7 +1414,6 @@ __export(server_exports, {
1414
1414
  isImportTypeNode: () => isImportTypeNode,
1415
1415
  isImportableFile: () => isImportableFile,
1416
1416
  isInComment: () => isInComment,
1417
- isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
1418
1417
  isInExpressionContext: () => isInExpressionContext,
1419
1418
  isInJSDoc: () => isInJSDoc,
1420
1419
  isInJSFile: () => isInJSFile,
@@ -1707,7 +1706,6 @@ __export(server_exports, {
1707
1706
  isSetAccessor: () => isSetAccessor,
1708
1707
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
1709
1708
  isShebangTrivia: () => isShebangTrivia,
1710
- isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
1711
1709
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
1712
1710
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
1713
1711
  isSignedNumericLiteral: () => isSignedNumericLiteral,
@@ -17127,8 +17125,8 @@ function isInExpressionContext(node) {
17127
17125
  return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
17128
17126
  case 249 /* ForInStatement */:
17129
17127
  case 250 /* ForOfStatement */:
17130
- const forInOrOfStatement = parent2;
17131
- return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node;
17128
+ const forInStatement = parent2;
17129
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInStatement.expression === node;
17132
17130
  case 216 /* TypeAssertionExpression */:
17133
17131
  case 234 /* AsExpression */:
17134
17132
  return node === parent2.expression;
@@ -17824,23 +17822,20 @@ var AssignmentKind = /* @__PURE__ */ ((AssignmentKind2) => {
17824
17822
  AssignmentKind2[AssignmentKind2["Compound"] = 2] = "Compound";
17825
17823
  return AssignmentKind2;
17826
17824
  })(AssignmentKind || {});
17827
- function getAssignmentTarget(node) {
17825
+ function getAssignmentTargetKind(node) {
17828
17826
  let parent2 = node.parent;
17829
17827
  while (true) {
17830
17828
  switch (parent2.kind) {
17831
17829
  case 226 /* BinaryExpression */:
17832
- const binaryExpression = parent2;
17833
- const binaryOperator = binaryExpression.operatorToken.kind;
17834
- return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0;
17830
+ const binaryOperator = parent2.operatorToken.kind;
17831
+ return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
17835
17832
  case 224 /* PrefixUnaryExpression */:
17836
17833
  case 225 /* PostfixUnaryExpression */:
17837
- const unaryExpression = parent2;
17838
- const unaryOperator = unaryExpression.operator;
17839
- return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0;
17834
+ const unaryOperator = parent2.operator;
17835
+ return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
17840
17836
  case 249 /* ForInStatement */:
17841
17837
  case 250 /* ForOfStatement */:
17842
- const forInOrOfStatement = parent2;
17843
- return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0;
17838
+ return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */;
17844
17839
  case 217 /* ParenthesizedExpression */:
17845
17840
  case 209 /* ArrayLiteralExpression */:
17846
17841
  case 230 /* SpreadElement */:
@@ -17852,53 +17847,24 @@ function getAssignmentTarget(node) {
17852
17847
  break;
17853
17848
  case 304 /* ShorthandPropertyAssignment */:
17854
17849
  if (parent2.name !== node) {
17855
- return void 0;
17850
+ return 0 /* None */;
17856
17851
  }
17857
17852
  node = parent2.parent;
17858
17853
  break;
17859
17854
  case 303 /* PropertyAssignment */:
17860
17855
  if (parent2.name === node) {
17861
- return void 0;
17856
+ return 0 /* None */;
17862
17857
  }
17863
17858
  node = parent2.parent;
17864
17859
  break;
17865
17860
  default:
17866
- return void 0;
17861
+ return 0 /* None */;
17867
17862
  }
17868
17863
  parent2 = node.parent;
17869
17864
  }
17870
17865
  }
17871
- function getAssignmentTargetKind(node) {
17872
- const target = getAssignmentTarget(node);
17873
- if (!target) {
17874
- return 0 /* None */;
17875
- }
17876
- switch (target.kind) {
17877
- case 226 /* BinaryExpression */:
17878
- const binaryOperator = target.operatorToken.kind;
17879
- return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */;
17880
- case 224 /* PrefixUnaryExpression */:
17881
- case 225 /* PostfixUnaryExpression */:
17882
- return 2 /* Compound */;
17883
- case 249 /* ForInStatement */:
17884
- case 250 /* ForOfStatement */:
17885
- return 1 /* Definite */;
17886
- }
17887
- }
17888
17866
  function isAssignmentTarget(node) {
17889
- return !!getAssignmentTarget(node);
17890
- }
17891
- function isCompoundLikeAssignment(assignment) {
17892
- const right = skipParentheses(assignment.right);
17893
- return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind);
17894
- }
17895
- function isInCompoundLikeAssignment(node) {
17896
- const target = getAssignmentTarget(node);
17897
- return !!target && isAssignmentExpression(
17898
- target,
17899
- /*excludeCompoundAssignment*/
17900
- true
17901
- ) && isCompoundLikeAssignment(target);
17867
+ return getAssignmentTargetKind(node) !== 0 /* None */;
17902
17868
  }
17903
17869
  function isNodeWithPossibleHoistedDeclaration(node) {
17904
17870
  switch (node.kind) {
@@ -69881,11 +69847,10 @@ function createTypeChecker(host) {
69881
69847
  const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));
69882
69848
  return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
69883
69849
  }
69884
- const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType;
69885
- if (t.flags & 1048576 /* Union */) {
69886
- return getAssignmentReducedType(t, getInitialOrAssignedType(flow));
69850
+ if (declaredType.flags & 1048576 /* Union */) {
69851
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow));
69887
69852
  }
69888
- return t;
69853
+ return declaredType;
69889
69854
  }
69890
69855
  if (containsMatchingReference(reference, node)) {
69891
69856
  if (!isReachableFlowNode(flow)) {
@@ -70312,14 +70277,12 @@ function createTypeChecker(host) {
70312
70277
  return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
70313
70278
  }
70314
70279
  const target = getReferenceCandidate(expr.right);
70315
- const leftType = getTypeOfExpression(expr.left);
70316
- if (leftType.flags & 8576 /* StringOrNumberLiteralOrUnique */) {
70317
- if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target) && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
70318
- return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
70319
- }
70320
- if (isMatchingReference(reference, target)) {
70321
- return narrowTypeByInKeyword(type, leftType, assumeTrue);
70322
- }
70280
+ let leftType;
70281
+ if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target) && (leftType = getTypeOfExpression(expr.left)).flags & 8576 /* StringOrNumberLiteralOrUnique */ && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
70282
+ return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
70283
+ }
70284
+ if (isMatchingReference(reference, target) && (leftType = getTypeOfExpression(expr.left)).flags & 8576 /* StringOrNumberLiteralOrUnique */) {
70285
+ return narrowTypeByInKeyword(type, leftType, assumeTrue);
70323
70286
  }
70324
70287
  break;
70325
70288
  case 28 /* CommaToken */:
@@ -71014,7 +70977,7 @@ function createTypeChecker(host) {
71014
70977
  const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;
71015
70978
  if (localOrExportSymbol.flags & 3 /* Variable */) {
71016
70979
  if (assignmentKind === 1 /* Definite */) {
71017
- return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type;
70980
+ return type;
71018
70981
  }
71019
70982
  } else if (isAlias) {
71020
70983
  declaration = getDeclarationOfAliasSymbol(symbol);
@@ -173025,7 +172988,6 @@ __export(ts_exports2, {
173025
172988
  isImportTypeNode: () => isImportTypeNode,
173026
172989
  isImportableFile: () => isImportableFile,
173027
172990
  isInComment: () => isInComment,
173028
- isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
173029
172991
  isInExpressionContext: () => isInExpressionContext,
173030
172992
  isInJSDoc: () => isInJSDoc,
173031
172993
  isInJSFile: () => isInJSFile,
@@ -173318,7 +173280,6 @@ __export(ts_exports2, {
173318
173280
  isSetAccessor: () => isSetAccessor,
173319
173281
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
173320
173282
  isShebangTrivia: () => isShebangTrivia,
173321
- isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
173322
173283
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
173323
173284
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
173324
173285
  isSignedNumericLiteral: () => isSignedNumericLiteral,
@@ -187540,7 +187501,6 @@ start(initializeNodeSystem(), require("os").platform());
187540
187501
  isImportTypeNode,
187541
187502
  isImportableFile,
187542
187503
  isInComment,
187543
- isInCompoundLikeAssignment,
187544
187504
  isInExpressionContext,
187545
187505
  isInJSDoc,
187546
187506
  isInJSFile,
@@ -187833,7 +187793,6 @@ start(initializeNodeSystem(), require("os").platform());
187833
187793
  isSetAccessor,
187834
187794
  isSetAccessorDeclaration,
187835
187795
  isShebangTrivia,
187836
- isShiftOperatorOrHigher,
187837
187796
  isShorthandAmbientModuleSymbol,
187838
187797
  isShorthandPropertyAssignment,
187839
187798
  isSignedNumericLiteral,
@@ -14905,8 +14905,8 @@ ${lanes.join("\n")}
14905
14905
  return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
14906
14906
  case 249 /* ForInStatement */:
14907
14907
  case 250 /* ForOfStatement */:
14908
- const forInOrOfStatement = parent2;
14909
- return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node;
14908
+ const forInStatement = parent2;
14909
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInStatement.expression === node;
14910
14910
  case 216 /* TypeAssertionExpression */:
14911
14911
  case 234 /* AsExpression */:
14912
14912
  return node === parent2.expression;
@@ -15596,23 +15596,20 @@ ${lanes.join("\n")}
15596
15596
  function hasTypeArguments(node) {
15597
15597
  return !!node.typeArguments;
15598
15598
  }
15599
- function getAssignmentTarget(node) {
15599
+ function getAssignmentTargetKind(node) {
15600
15600
  let parent2 = node.parent;
15601
15601
  while (true) {
15602
15602
  switch (parent2.kind) {
15603
15603
  case 226 /* BinaryExpression */:
15604
- const binaryExpression = parent2;
15605
- const binaryOperator = binaryExpression.operatorToken.kind;
15606
- return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0;
15604
+ const binaryOperator = parent2.operatorToken.kind;
15605
+ return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
15607
15606
  case 224 /* PrefixUnaryExpression */:
15608
15607
  case 225 /* PostfixUnaryExpression */:
15609
- const unaryExpression = parent2;
15610
- const unaryOperator = unaryExpression.operator;
15611
- return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0;
15608
+ const unaryOperator = parent2.operator;
15609
+ return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
15612
15610
  case 249 /* ForInStatement */:
15613
15611
  case 250 /* ForOfStatement */:
15614
- const forInOrOfStatement = parent2;
15615
- return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0;
15612
+ return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */;
15616
15613
  case 217 /* ParenthesizedExpression */:
15617
15614
  case 209 /* ArrayLiteralExpression */:
15618
15615
  case 230 /* SpreadElement */:
@@ -15624,53 +15621,24 @@ ${lanes.join("\n")}
15624
15621
  break;
15625
15622
  case 304 /* ShorthandPropertyAssignment */:
15626
15623
  if (parent2.name !== node) {
15627
- return void 0;
15624
+ return 0 /* None */;
15628
15625
  }
15629
15626
  node = parent2.parent;
15630
15627
  break;
15631
15628
  case 303 /* PropertyAssignment */:
15632
15629
  if (parent2.name === node) {
15633
- return void 0;
15630
+ return 0 /* None */;
15634
15631
  }
15635
15632
  node = parent2.parent;
15636
15633
  break;
15637
15634
  default:
15638
- return void 0;
15635
+ return 0 /* None */;
15639
15636
  }
15640
15637
  parent2 = node.parent;
15641
15638
  }
15642
15639
  }
15643
- function getAssignmentTargetKind(node) {
15644
- const target = getAssignmentTarget(node);
15645
- if (!target) {
15646
- return 0 /* None */;
15647
- }
15648
- switch (target.kind) {
15649
- case 226 /* BinaryExpression */:
15650
- const binaryOperator = target.operatorToken.kind;
15651
- return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */;
15652
- case 224 /* PrefixUnaryExpression */:
15653
- case 225 /* PostfixUnaryExpression */:
15654
- return 2 /* Compound */;
15655
- case 249 /* ForInStatement */:
15656
- case 250 /* ForOfStatement */:
15657
- return 1 /* Definite */;
15658
- }
15659
- }
15660
15640
  function isAssignmentTarget(node) {
15661
- return !!getAssignmentTarget(node);
15662
- }
15663
- function isCompoundLikeAssignment(assignment) {
15664
- const right = skipParentheses(assignment.right);
15665
- return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind);
15666
- }
15667
- function isInCompoundLikeAssignment(node) {
15668
- const target = getAssignmentTarget(node);
15669
- return !!target && isAssignmentExpression(
15670
- target,
15671
- /*excludeCompoundAssignment*/
15672
- true
15673
- ) && isCompoundLikeAssignment(target);
15641
+ return getAssignmentTargetKind(node) !== 0 /* None */;
15674
15642
  }
15675
15643
  function isNodeWithPossibleHoistedDeclaration(node) {
15676
15644
  switch (node.kind) {
@@ -67646,11 +67614,10 @@ ${lanes.join("\n")}
67646
67614
  const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));
67647
67615
  return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
67648
67616
  }
67649
- const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType;
67650
- if (t.flags & 1048576 /* Union */) {
67651
- return getAssignmentReducedType(t, getInitialOrAssignedType(flow));
67617
+ if (declaredType.flags & 1048576 /* Union */) {
67618
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow));
67652
67619
  }
67653
- return t;
67620
+ return declaredType;
67654
67621
  }
67655
67622
  if (containsMatchingReference(reference, node)) {
67656
67623
  if (!isReachableFlowNode(flow)) {
@@ -68077,14 +68044,12 @@ ${lanes.join("\n")}
68077
68044
  return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
68078
68045
  }
68079
68046
  const target = getReferenceCandidate(expr.right);
68080
- const leftType = getTypeOfExpression(expr.left);
68081
- if (leftType.flags & 8576 /* StringOrNumberLiteralOrUnique */) {
68082
- if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target) && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
68083
- return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
68084
- }
68085
- if (isMatchingReference(reference, target)) {
68086
- return narrowTypeByInKeyword(type, leftType, assumeTrue);
68087
- }
68047
+ let leftType;
68048
+ if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target) && (leftType = getTypeOfExpression(expr.left)).flags & 8576 /* StringOrNumberLiteralOrUnique */ && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
68049
+ return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
68050
+ }
68051
+ if (isMatchingReference(reference, target) && (leftType = getTypeOfExpression(expr.left)).flags & 8576 /* StringOrNumberLiteralOrUnique */) {
68052
+ return narrowTypeByInKeyword(type, leftType, assumeTrue);
68088
68053
  }
68089
68054
  break;
68090
68055
  case 28 /* CommaToken */:
@@ -68779,7 +68744,7 @@ ${lanes.join("\n")}
68779
68744
  const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;
68780
68745
  if (localOrExportSymbol.flags & 3 /* Variable */) {
68781
68746
  if (assignmentKind === 1 /* Definite */) {
68782
- return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type;
68747
+ return type;
68783
68748
  }
68784
68749
  } else if (isAlias) {
68785
68750
  declaration = getDeclarationOfAliasSymbol(symbol);
@@ -184163,7 +184128,6 @@ ${e.message}`;
184163
184128
  isImportTypeNode: () => isImportTypeNode,
184164
184129
  isImportableFile: () => isImportableFile,
184165
184130
  isInComment: () => isInComment,
184166
- isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
184167
184131
  isInExpressionContext: () => isInExpressionContext,
184168
184132
  isInJSDoc: () => isInJSDoc,
184169
184133
  isInJSFile: () => isInJSFile,
@@ -184456,7 +184420,6 @@ ${e.message}`;
184456
184420
  isSetAccessor: () => isSetAccessor,
184457
184421
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
184458
184422
  isShebangTrivia: () => isShebangTrivia,
184459
- isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
184460
184423
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
184461
184424
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
184462
184425
  isSignedNumericLiteral: () => isSignedNumericLiteral,
@@ -186568,7 +186531,6 @@ ${e.message}`;
186568
186531
  isImportTypeNode: () => isImportTypeNode,
186569
186532
  isImportableFile: () => isImportableFile,
186570
186533
  isInComment: () => isInComment,
186571
- isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
186572
186534
  isInExpressionContext: () => isInExpressionContext,
186573
186535
  isInJSDoc: () => isInJSDoc,
186574
186536
  isInJSFile: () => isInJSFile,
@@ -186861,7 +186823,6 @@ ${e.message}`;
186861
186823
  isSetAccessor: () => isSetAccessor,
186862
186824
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
186863
186825
  isShebangTrivia: () => isShebangTrivia,
186864
- isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
186865
186826
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
186866
186827
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
186867
186828
  isSignedNumericLiteral: () => isSignedNumericLiteral,
package/lib/typescript.js CHANGED
@@ -14905,8 +14905,8 @@ ${lanes.join("\n")}
14905
14905
  return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
14906
14906
  case 249 /* ForInStatement */:
14907
14907
  case 250 /* ForOfStatement */:
14908
- const forInOrOfStatement = parent2;
14909
- return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node;
14908
+ const forInStatement = parent2;
14909
+ return forInStatement.initializer === node && forInStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInStatement.expression === node;
14910
14910
  case 216 /* TypeAssertionExpression */:
14911
14911
  case 234 /* AsExpression */:
14912
14912
  return node === parent2.expression;
@@ -15596,23 +15596,20 @@ ${lanes.join("\n")}
15596
15596
  function hasTypeArguments(node) {
15597
15597
  return !!node.typeArguments;
15598
15598
  }
15599
- function getAssignmentTarget(node) {
15599
+ function getAssignmentTargetKind(node) {
15600
15600
  let parent2 = node.parent;
15601
15601
  while (true) {
15602
15602
  switch (parent2.kind) {
15603
15603
  case 226 /* BinaryExpression */:
15604
- const binaryExpression = parent2;
15605
- const binaryOperator = binaryExpression.operatorToken.kind;
15606
- return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0;
15604
+ const binaryOperator = parent2.operatorToken.kind;
15605
+ return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
15607
15606
  case 224 /* PrefixUnaryExpression */:
15608
15607
  case 225 /* PostfixUnaryExpression */:
15609
- const unaryExpression = parent2;
15610
- const unaryOperator = unaryExpression.operator;
15611
- return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0;
15608
+ const unaryOperator = parent2.operator;
15609
+ return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
15612
15610
  case 249 /* ForInStatement */:
15613
15611
  case 250 /* ForOfStatement */:
15614
- const forInOrOfStatement = parent2;
15615
- return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0;
15612
+ return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */;
15616
15613
  case 217 /* ParenthesizedExpression */:
15617
15614
  case 209 /* ArrayLiteralExpression */:
15618
15615
  case 230 /* SpreadElement */:
@@ -15624,53 +15621,24 @@ ${lanes.join("\n")}
15624
15621
  break;
15625
15622
  case 304 /* ShorthandPropertyAssignment */:
15626
15623
  if (parent2.name !== node) {
15627
- return void 0;
15624
+ return 0 /* None */;
15628
15625
  }
15629
15626
  node = parent2.parent;
15630
15627
  break;
15631
15628
  case 303 /* PropertyAssignment */:
15632
15629
  if (parent2.name === node) {
15633
- return void 0;
15630
+ return 0 /* None */;
15634
15631
  }
15635
15632
  node = parent2.parent;
15636
15633
  break;
15637
15634
  default:
15638
- return void 0;
15635
+ return 0 /* None */;
15639
15636
  }
15640
15637
  parent2 = node.parent;
15641
15638
  }
15642
15639
  }
15643
- function getAssignmentTargetKind(node) {
15644
- const target = getAssignmentTarget(node);
15645
- if (!target) {
15646
- return 0 /* None */;
15647
- }
15648
- switch (target.kind) {
15649
- case 226 /* BinaryExpression */:
15650
- const binaryOperator = target.operatorToken.kind;
15651
- return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */;
15652
- case 224 /* PrefixUnaryExpression */:
15653
- case 225 /* PostfixUnaryExpression */:
15654
- return 2 /* Compound */;
15655
- case 249 /* ForInStatement */:
15656
- case 250 /* ForOfStatement */:
15657
- return 1 /* Definite */;
15658
- }
15659
- }
15660
15640
  function isAssignmentTarget(node) {
15661
- return !!getAssignmentTarget(node);
15662
- }
15663
- function isCompoundLikeAssignment(assignment) {
15664
- const right = skipParentheses(assignment.right);
15665
- return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind);
15666
- }
15667
- function isInCompoundLikeAssignment(node) {
15668
- const target = getAssignmentTarget(node);
15669
- return !!target && isAssignmentExpression(
15670
- target,
15671
- /*excludeCompoundAssignment*/
15672
- true
15673
- ) && isCompoundLikeAssignment(target);
15641
+ return getAssignmentTargetKind(node) !== 0 /* None */;
15674
15642
  }
15675
15643
  function isNodeWithPossibleHoistedDeclaration(node) {
15676
15644
  switch (node.kind) {
@@ -67646,11 +67614,10 @@ ${lanes.join("\n")}
67646
67614
  const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));
67647
67615
  return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
67648
67616
  }
67649
- const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType;
67650
- if (t.flags & 1048576 /* Union */) {
67651
- return getAssignmentReducedType(t, getInitialOrAssignedType(flow));
67617
+ if (declaredType.flags & 1048576 /* Union */) {
67618
+ return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow));
67652
67619
  }
67653
- return t;
67620
+ return declaredType;
67654
67621
  }
67655
67622
  if (containsMatchingReference(reference, node)) {
67656
67623
  if (!isReachableFlowNode(flow)) {
@@ -68077,14 +68044,12 @@ ${lanes.join("\n")}
68077
68044
  return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
68078
68045
  }
68079
68046
  const target = getReferenceCandidate(expr.right);
68080
- const leftType = getTypeOfExpression(expr.left);
68081
- if (leftType.flags & 8576 /* StringOrNumberLiteralOrUnique */) {
68082
- if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target) && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
68083
- return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
68084
- }
68085
- if (isMatchingReference(reference, target)) {
68086
- return narrowTypeByInKeyword(type, leftType, assumeTrue);
68087
- }
68047
+ let leftType;
68048
+ if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target) && (leftType = getTypeOfExpression(expr.left)).flags & 8576 /* StringOrNumberLiteralOrUnique */ && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
68049
+ return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
68050
+ }
68051
+ if (isMatchingReference(reference, target) && (leftType = getTypeOfExpression(expr.left)).flags & 8576 /* StringOrNumberLiteralOrUnique */) {
68052
+ return narrowTypeByInKeyword(type, leftType, assumeTrue);
68088
68053
  }
68089
68054
  break;
68090
68055
  case 28 /* CommaToken */:
@@ -68779,7 +68744,7 @@ ${lanes.join("\n")}
68779
68744
  const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;
68780
68745
  if (localOrExportSymbol.flags & 3 /* Variable */) {
68781
68746
  if (assignmentKind === 1 /* Definite */) {
68782
- return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type;
68747
+ return type;
68783
68748
  }
68784
68749
  } else if (isAlias) {
68785
68750
  declaration = getDeclarationOfAliasSymbol(symbol);
@@ -172785,7 +172750,6 @@ ${options.prefix}` : "\n" : options.prefix
172785
172750
  isImportTypeNode: () => isImportTypeNode,
172786
172751
  isImportableFile: () => isImportableFile,
172787
172752
  isInComment: () => isInComment,
172788
- isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
172789
172753
  isInExpressionContext: () => isInExpressionContext,
172790
172754
  isInJSDoc: () => isInJSDoc,
172791
172755
  isInJSFile: () => isInJSFile,
@@ -173078,7 +173042,6 @@ ${options.prefix}` : "\n" : options.prefix
173078
173042
  isSetAccessor: () => isSetAccessor,
173079
173043
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
173080
173044
  isShebangTrivia: () => isShebangTrivia,
173081
- isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
173082
173045
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
173083
173046
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
173084
173047
  isSignedNumericLiteral: () => isSignedNumericLiteral,
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.2.0-pr-52493-8",
5
+ "version": "5.2.0-pr-54795-7",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "d2eb04a9bf92fb96607b2a314bc382456fee514d"
118
+ "gitHead": "77b53fe6bf7e4cd647cc4c44affd81f70e7597d9"
119
119
  }