@typescript-deploys/pr-build 5.4.0-pr-56183-8 → 5.4.0-pr-56305-8

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
@@ -68111,17 +68111,6 @@ function createTypeChecker(host) {
68111
68111
  isTypeAssignableTo
68112
68112
  );
68113
68113
  }
68114
- function filterContextualTypeForLiteralExpressionOfObject(node, contextualType) {
68115
- if (!isLiteralExpressionOfObject(node)) {
68116
- return contextualType;
68117
- }
68118
- return filterType(contextualType, (t) => {
68119
- if (!t.symbol || !(t.symbol.flags & 32 /* Class */)) {
68120
- return true;
68121
- }
68122
- return every(getPropertiesOfType(t), (p) => !p.valueDeclaration || !isNamedDeclaration(p.valueDeclaration) || !isPrivateIdentifier(p.valueDeclaration.name) && !(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */));
68123
- });
68124
- }
68125
68114
  function getApparentTypeOfContextualType(node, contextFlags) {
68126
68115
  const contextualType = isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node, contextFlags) : getContextualType(node, contextFlags);
68127
68116
  const instantiatedType = instantiateContextualType(contextualType, node, contextFlags);
@@ -68165,6 +68154,7 @@ function createTypeChecker(host) {
68165
68154
  return type;
68166
68155
  }
68167
68156
  function getContextualType(node, contextFlags) {
68157
+ var _a;
68168
68158
  if (node.flags & 67108864 /* InWithStatement */) {
68169
68159
  return void 0;
68170
68160
  }
@@ -68176,14 +68166,6 @@ function createTypeChecker(host) {
68176
68166
  if (index >= 0) {
68177
68167
  return contextualTypes[index];
68178
68168
  }
68179
- const contextualType = getContextualTypeWorker(node, contextFlags);
68180
- if (!contextualType) {
68181
- return void 0;
68182
- }
68183
- return filterContextualTypeForLiteralExpressionOfObject(node, contextualType);
68184
- }
68185
- function getContextualTypeWorker(node, contextFlags) {
68186
- var _a;
68187
68169
  const { parent } = node;
68188
68170
  switch (parent.kind) {
68189
68171
  case 260 /* VariableDeclaration */:
@@ -74297,6 +74279,9 @@ function createTypeChecker(host) {
74297
74279
  return false;
74298
74280
  }
74299
74281
  }
74282
+ function isTypeStrictEqualityComparableTo(source, target) {
74283
+ return (target.flags & 32768 /* Undefined */) !== 0 || isTypeComparableTo(source, target);
74284
+ }
74300
74285
  function isTypeEqualityComparableTo(source, target) {
74301
74286
  return (target.flags & 98304 /* Nullable */) !== 0 || isTypeComparableTo(source, target);
74302
74287
  }
@@ -74615,7 +74600,8 @@ function createTypeChecker(host) {
74615
74600
  error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
74616
74601
  }
74617
74602
  checkNaNEquality(errorNode, operator, left, right);
74618
- reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
74603
+ const checkFunction = operator === 35 /* EqualsEqualsToken */ || operator === 36 /* ExclamationEqualsToken */ ? isTypeEqualityComparableTo : isTypeStrictEqualityComparableTo;
74604
+ reportOperatorErrorUnless((left2, right2) => checkFunction(left2, right2) || checkFunction(right2, left2));
74619
74605
  }
74620
74606
  return booleanType;
74621
74607
  case 104 /* InstanceOfKeyword */:
@@ -74964,11 +74950,10 @@ function createTypeChecker(host) {
74964
74950
  return node;
74965
74951
  }
74966
74952
  function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) {
74967
- const filteredContextualType = filterContextualTypeForLiteralExpressionOfObject(node, contextualType);
74968
74953
  const contextNode = getContextNode(node);
74969
74954
  pushContextualType(
74970
74955
  contextNode,
74971
- filteredContextualType,
74956
+ contextualType,
74972
74957
  /*isCache*/
74973
74958
  false
74974
74959
  );
@@ -74978,7 +74963,7 @@ function createTypeChecker(host) {
74978
74963
  inferenceContext.intraExpressionInferenceSites = void 0;
74979
74964
  }
74980
74965
  const result = maybeTypeOfKind(type, 2944 /* Literal */) && isLiteralOfContextualType(type, instantiateContextualType(
74981
- filteredContextualType,
74966
+ contextualType,
74982
74967
  node,
74983
74968
  /*contextFlags*/
74984
74969
  void 0
@@ -126066,8 +126051,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
126066
126051
  default:
126067
126052
  const inverted = {};
126068
126053
  option3.type.forEach((value, name2) => {
126069
- var _a2;
126070
- if (!((_a2 = option3.deprecatedKeys) == null ? void 0 : _a2.has(name2))) {
126054
+ if (!(option3.deprecatedKeys && option3.deprecatedKeys.has(name2))) {
126071
126055
  (inverted[value] || (inverted[value] = [])).push(name2);
126072
126056
  }
126073
126057
  });
package/lib/tsserver.js CHANGED
@@ -72817,17 +72817,6 @@ function createTypeChecker(host) {
72817
72817
  isTypeAssignableTo
72818
72818
  );
72819
72819
  }
72820
- function filterContextualTypeForLiteralExpressionOfObject(node, contextualType) {
72821
- if (!isLiteralExpressionOfObject(node)) {
72822
- return contextualType;
72823
- }
72824
- return filterType(contextualType, (t) => {
72825
- if (!t.symbol || !(t.symbol.flags & 32 /* Class */)) {
72826
- return true;
72827
- }
72828
- return every(getPropertiesOfType(t), (p) => !p.valueDeclaration || !isNamedDeclaration(p.valueDeclaration) || !isPrivateIdentifier(p.valueDeclaration.name) && !(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */));
72829
- });
72830
- }
72831
72820
  function getApparentTypeOfContextualType(node, contextFlags) {
72832
72821
  const contextualType = isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node, contextFlags) : getContextualType2(node, contextFlags);
72833
72822
  const instantiatedType = instantiateContextualType(contextualType, node, contextFlags);
@@ -72871,6 +72860,7 @@ function createTypeChecker(host) {
72871
72860
  return type;
72872
72861
  }
72873
72862
  function getContextualType2(node, contextFlags) {
72863
+ var _a;
72874
72864
  if (node.flags & 67108864 /* InWithStatement */) {
72875
72865
  return void 0;
72876
72866
  }
@@ -72882,14 +72872,6 @@ function createTypeChecker(host) {
72882
72872
  if (index >= 0) {
72883
72873
  return contextualTypes[index];
72884
72874
  }
72885
- const contextualType = getContextualTypeWorker(node, contextFlags);
72886
- if (!contextualType) {
72887
- return void 0;
72888
- }
72889
- return filterContextualTypeForLiteralExpressionOfObject(node, contextualType);
72890
- }
72891
- function getContextualTypeWorker(node, contextFlags) {
72892
- var _a;
72893
72875
  const { parent: parent2 } = node;
72894
72876
  switch (parent2.kind) {
72895
72877
  case 260 /* VariableDeclaration */:
@@ -79003,6 +78985,9 @@ function createTypeChecker(host) {
79003
78985
  return false;
79004
78986
  }
79005
78987
  }
78988
+ function isTypeStrictEqualityComparableTo(source, target) {
78989
+ return (target.flags & 32768 /* Undefined */) !== 0 || isTypeComparableTo(source, target);
78990
+ }
79006
78991
  function isTypeEqualityComparableTo(source, target) {
79007
78992
  return (target.flags & 98304 /* Nullable */) !== 0 || isTypeComparableTo(source, target);
79008
78993
  }
@@ -79321,7 +79306,8 @@ function createTypeChecker(host) {
79321
79306
  error2(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
79322
79307
  }
79323
79308
  checkNaNEquality(errorNode, operator, left, right);
79324
- reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
79309
+ const checkFunction = operator === 35 /* EqualsEqualsToken */ || operator === 36 /* ExclamationEqualsToken */ ? isTypeEqualityComparableTo : isTypeStrictEqualityComparableTo;
79310
+ reportOperatorErrorUnless((left2, right2) => checkFunction(left2, right2) || checkFunction(right2, left2));
79325
79311
  }
79326
79312
  return booleanType;
79327
79313
  case 104 /* InstanceOfKeyword */:
@@ -79670,11 +79656,10 @@ function createTypeChecker(host) {
79670
79656
  return node;
79671
79657
  }
79672
79658
  function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) {
79673
- const filteredContextualType = filterContextualTypeForLiteralExpressionOfObject(node, contextualType);
79674
79659
  const contextNode = getContextNode2(node);
79675
79660
  pushContextualType(
79676
79661
  contextNode,
79677
- filteredContextualType,
79662
+ contextualType,
79678
79663
  /*isCache*/
79679
79664
  false
79680
79665
  );
@@ -79684,7 +79669,7 @@ function createTypeChecker(host) {
79684
79669
  inferenceContext.intraExpressionInferenceSites = void 0;
79685
79670
  }
79686
79671
  const result = maybeTypeOfKind(type, 2944 /* Literal */) && isLiteralOfContextualType(type, instantiateContextualType(
79687
- filteredContextualType,
79672
+ contextualType,
79688
79673
  node,
79689
79674
  /*contextFlags*/
79690
79675
  void 0
@@ -160825,7 +160810,7 @@ function getApparentProperties(type, node, checker) {
160825
160810
  return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 402784252 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || checker.typeHasCallOrConstructSignatures(memberType) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties()))));
160826
160811
  }
160827
160812
  function containsNonPublicProperties(props) {
160828
- return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */) || !!p.valueDeclaration && isNamedDeclaration(p.valueDeclaration) && isPrivateIdentifier(p.valueDeclaration.name));
160813
+ return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */));
160829
160814
  }
160830
160815
  function getPropertiesForCompletion(type, checker) {
160831
160816
  return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined");
package/lib/typescript.js CHANGED
@@ -70582,17 +70582,6 @@ ${lanes.join("\n")}
70582
70582
  isTypeAssignableTo
70583
70583
  );
70584
70584
  }
70585
- function filterContextualTypeForLiteralExpressionOfObject(node, contextualType) {
70586
- if (!isLiteralExpressionOfObject(node)) {
70587
- return contextualType;
70588
- }
70589
- return filterType(contextualType, (t) => {
70590
- if (!t.symbol || !(t.symbol.flags & 32 /* Class */)) {
70591
- return true;
70592
- }
70593
- return every(getPropertiesOfType(t), (p) => !p.valueDeclaration || !isNamedDeclaration(p.valueDeclaration) || !isPrivateIdentifier(p.valueDeclaration.name) && !(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */));
70594
- });
70595
- }
70596
70585
  function getApparentTypeOfContextualType(node, contextFlags) {
70597
70586
  const contextualType = isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node, contextFlags) : getContextualType2(node, contextFlags);
70598
70587
  const instantiatedType = instantiateContextualType(contextualType, node, contextFlags);
@@ -70636,6 +70625,7 @@ ${lanes.join("\n")}
70636
70625
  return type;
70637
70626
  }
70638
70627
  function getContextualType2(node, contextFlags) {
70628
+ var _a;
70639
70629
  if (node.flags & 67108864 /* InWithStatement */) {
70640
70630
  return void 0;
70641
70631
  }
@@ -70647,14 +70637,6 @@ ${lanes.join("\n")}
70647
70637
  if (index >= 0) {
70648
70638
  return contextualTypes[index];
70649
70639
  }
70650
- const contextualType = getContextualTypeWorker(node, contextFlags);
70651
- if (!contextualType) {
70652
- return void 0;
70653
- }
70654
- return filterContextualTypeForLiteralExpressionOfObject(node, contextualType);
70655
- }
70656
- function getContextualTypeWorker(node, contextFlags) {
70657
- var _a;
70658
70640
  const { parent: parent2 } = node;
70659
70641
  switch (parent2.kind) {
70660
70642
  case 260 /* VariableDeclaration */:
@@ -76768,6 +76750,9 @@ ${lanes.join("\n")}
76768
76750
  return false;
76769
76751
  }
76770
76752
  }
76753
+ function isTypeStrictEqualityComparableTo(source, target) {
76754
+ return (target.flags & 32768 /* Undefined */) !== 0 || isTypeComparableTo(source, target);
76755
+ }
76771
76756
  function isTypeEqualityComparableTo(source, target) {
76772
76757
  return (target.flags & 98304 /* Nullable */) !== 0 || isTypeComparableTo(source, target);
76773
76758
  }
@@ -77086,7 +77071,8 @@ ${lanes.join("\n")}
77086
77071
  error2(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
77087
77072
  }
77088
77073
  checkNaNEquality(errorNode, operator, left, right);
77089
- reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
77074
+ const checkFunction = operator === 35 /* EqualsEqualsToken */ || operator === 36 /* ExclamationEqualsToken */ ? isTypeEqualityComparableTo : isTypeStrictEqualityComparableTo;
77075
+ reportOperatorErrorUnless((left2, right2) => checkFunction(left2, right2) || checkFunction(right2, left2));
77090
77076
  }
77091
77077
  return booleanType;
77092
77078
  case 104 /* InstanceOfKeyword */:
@@ -77435,11 +77421,10 @@ ${lanes.join("\n")}
77435
77421
  return node;
77436
77422
  }
77437
77423
  function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) {
77438
- const filteredContextualType = filterContextualTypeForLiteralExpressionOfObject(node, contextualType);
77439
77424
  const contextNode = getContextNode2(node);
77440
77425
  pushContextualType(
77441
77426
  contextNode,
77442
- filteredContextualType,
77427
+ contextualType,
77443
77428
  /*isCache*/
77444
77429
  false
77445
77430
  );
@@ -77449,7 +77434,7 @@ ${lanes.join("\n")}
77449
77434
  inferenceContext.intraExpressionInferenceSites = void 0;
77450
77435
  }
77451
77436
  const result = maybeTypeOfKind(type, 2944 /* Literal */) && isLiteralOfContextualType(type, instantiateContextualType(
77452
- filteredContextualType,
77437
+ contextualType,
77453
77438
  node,
77454
77439
  /*contextFlags*/
77455
77440
  void 0
@@ -160026,7 +160011,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160026
160011
  return checker.getAllPossiblePropertiesOfTypes(filter(type.types, (memberType) => !(memberType.flags & 402784252 /* Primitive */ || checker.isArrayLikeType(memberType) || checker.isTypeInvalidDueToUnionDiscriminant(memberType, node) || checker.typeHasCallOrConstructSignatures(memberType) || memberType.isClass() && containsNonPublicProperties(memberType.getApparentProperties()))));
160027
160012
  }
160028
160013
  function containsNonPublicProperties(props) {
160029
- return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */) || !!p.valueDeclaration && isNamedDeclaration(p.valueDeclaration) && isPrivateIdentifier(p.valueDeclaration.name));
160014
+ return some(props, (p) => !!(getDeclarationModifierFlagsFromSymbol(p) & 6 /* NonPublicAccessibilityModifier */));
160030
160015
  }
160031
160016
  function getPropertiesForCompletion(type, checker) {
160032
160017
  return type.isUnion() ? Debug.checkEachDefined(checker.getAllPossiblePropertiesOfTypes(type.types), "getAllPossiblePropertiesOfTypes() should all be defined") : Debug.checkEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined");
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-56183-8",
5
+ "version": "5.4.0-pr-56305-8",
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": "de05c8af5f4918259cc71f76f27beee2504bd80f"
118
+ "gitHead": "5fa4da58ed8a171def2dd10e4d9430a88ee80672"
119
119
  }