@typescript-deploys/pr-build 6.0.0-pr-62275-3 → 6.0.0-pr-62243-25

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 = "6.0";
21
- var version = `${versionMajorMinor}.0-insiders.20250812`;
21
+ var version = `${versionMajorMinor}.0-insiders.20250813`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -14265,12 +14265,15 @@ function forEachYieldExpression(body, visitor) {
14265
14265
  function traverse(node) {
14266
14266
  switch (node.kind) {
14267
14267
  case 230 /* YieldExpression */:
14268
- visitor(node);
14268
+ const value = visitor(node);
14269
+ if (value) {
14270
+ return value;
14271
+ }
14269
14272
  const operand = node.expression;
14270
- if (operand) {
14271
- traverse(operand);
14273
+ if (!operand) {
14274
+ return;
14272
14275
  }
14273
- return;
14276
+ return traverse(operand);
14274
14277
  case 267 /* EnumDeclaration */:
14275
14278
  case 265 /* InterfaceDeclaration */:
14276
14279
  case 268 /* ModuleDeclaration */:
@@ -14279,11 +14282,10 @@ function forEachYieldExpression(body, visitor) {
14279
14282
  default:
14280
14283
  if (isFunctionLike(node)) {
14281
14284
  if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
14282
- traverse(node.name.expression);
14283
- return;
14285
+ return traverse(node.name.expression);
14284
14286
  }
14285
14287
  } else if (!isPartOfTypeNode(node)) {
14286
- forEachChild(node, traverse);
14288
+ return forEachChild(node, traverse);
14287
14289
  }
14288
14290
  }
14289
14291
  }
@@ -19133,7 +19135,7 @@ function hasContextSensitiveParameters(node) {
19133
19135
  if (node.kind !== 220 /* ArrowFunction */) {
19134
19136
  const parameter = firstOrUndefined(node.parameters);
19135
19137
  if (!(parameter && parameterIsThisKeyword(parameter))) {
19136
- return true;
19138
+ return !!(node.flags & 256 /* ContainsThis */);
19137
19139
  }
19138
19140
  }
19139
19141
  }
@@ -42647,6 +42649,7 @@ function createBinder() {
42647
42649
  const saveExceptionTarget = currentExceptionTarget;
42648
42650
  const saveActiveLabelList = activeLabelList;
42649
42651
  const saveHasExplicitReturn = hasExplicitReturn;
42652
+ const saveSeenThisKeyword = seenThisKeyword;
42650
42653
  const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
42651
42654
  if (!isImmediatelyInvoked) {
42652
42655
  currentFlow = createFlowNode(
@@ -42666,13 +42669,17 @@ function createBinder() {
42666
42669
  currentContinueTarget = void 0;
42667
42670
  activeLabelList = void 0;
42668
42671
  hasExplicitReturn = false;
42672
+ seenThisKeyword = false;
42669
42673
  bindChildren(node);
42670
- node.flags &= ~5632 /* ReachabilityAndEmitFlags */;
42674
+ node.flags &= ~(5632 /* ReachabilityAndEmitFlags */ | 256 /* ContainsThis */);
42671
42675
  if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
42672
42676
  node.flags |= 512 /* HasImplicitReturn */;
42673
42677
  if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
42674
42678
  node.endFlowNode = currentFlow;
42675
42679
  }
42680
+ if (seenThisKeyword) {
42681
+ node.flags |= 256 /* ContainsThis */;
42682
+ }
42676
42683
  if (node.kind === 308 /* SourceFile */) {
42677
42684
  node.flags |= emitFlags;
42678
42685
  node.endFlowNode = currentFlow;
@@ -42693,11 +42700,14 @@ function createBinder() {
42693
42700
  currentExceptionTarget = saveExceptionTarget;
42694
42701
  activeLabelList = saveActiveLabelList;
42695
42702
  hasExplicitReturn = saveHasExplicitReturn;
42703
+ seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
42696
42704
  } else if (containerFlags & 64 /* IsInterface */) {
42705
+ const saveSeenThisKeyword = seenThisKeyword;
42697
42706
  seenThisKeyword = false;
42698
42707
  bindChildren(node);
42699
42708
  Debug.assertNotNode(node, isIdentifier);
42700
42709
  node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
42710
+ seenThisKeyword = saveSeenThisKeyword;
42701
42711
  } else {
42702
42712
  bindChildren(node);
42703
42713
  }
@@ -44185,6 +44195,9 @@ function createBinder() {
44185
44195
  }
44186
44196
  // falls through
44187
44197
  case 110 /* ThisKeyword */:
44198
+ if (node.kind === 110 /* ThisKeyword */) {
44199
+ seenThisKeyword = true;
44200
+ }
44188
44201
  if (currentFlow && (isExpression(node) || parent.kind === 305 /* ShorthandPropertyAssignment */)) {
44189
44202
  node.flowNode = currentFlow;
44190
44203
  }
@@ -45107,6 +45120,8 @@ function getContainerFlags(node) {
45107
45120
  // falls through
45108
45121
  case 177 /* Constructor */:
45109
45122
  case 263 /* FunctionDeclaration */:
45123
+ case 176 /* ClassStaticBlockDeclaration */:
45124
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
45110
45125
  case 174 /* MethodSignature */:
45111
45126
  case 180 /* CallSignature */:
45112
45127
  case 324 /* JSDocSignature */:
@@ -45114,17 +45129,14 @@ function getContainerFlags(node) {
45114
45129
  case 185 /* FunctionType */:
45115
45130
  case 181 /* ConstructSignature */:
45116
45131
  case 186 /* ConstructorType */:
45117
- case 176 /* ClassStaticBlockDeclaration */:
45118
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
45132
+ return 1 /* IsContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
45119
45133
  case 352 /* JSDocImportTag */:
45120
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
45134
+ return 1 /* IsContainer */ | 32 /* HasLocals */;
45121
45135
  case 219 /* FunctionExpression */:
45122
45136
  case 220 /* ArrowFunction */:
45123
45137
  return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
45124
45138
  case 269 /* ModuleBlock */:
45125
45139
  return 4 /* IsControlFlowContainer */;
45126
- case 173 /* PropertyDeclaration */:
45127
- return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
45128
45140
  case 300 /* CatchClause */:
45129
45141
  case 249 /* ForStatement */:
45130
45142
  case 250 /* ForInStatement */:
@@ -63738,7 +63750,8 @@ function createTypeChecker(host) {
63738
63750
  const { initializer } = node;
63739
63751
  return !!initializer && isContextSensitive(initializer);
63740
63752
  }
63741
- case 295 /* JsxExpression */: {
63753
+ case 295 /* JsxExpression */:
63754
+ case 230 /* YieldExpression */: {
63742
63755
  const { expression } = node;
63743
63756
  return !!expression && isContextSensitive(expression);
63744
63757
  }
@@ -63746,7 +63759,7 @@ function createTypeChecker(host) {
63746
63759
  return false;
63747
63760
  }
63748
63761
  function isContextSensitiveFunctionLikeDeclaration(node) {
63749
- return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
63762
+ return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node) || !!(getFunctionFlags(node) & 1 /* Generator */ && node.body && forEachYieldExpression(node.body, isContextSensitive));
63750
63763
  }
63751
63764
  function hasContextSensitiveReturnExpression(node) {
63752
63765
  if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
@@ -67132,7 +67145,7 @@ function createTypeChecker(host) {
67132
67145
  }
67133
67146
  function discriminateTypeByDiscriminableItems(target, discriminators, related) {
67134
67147
  const types = target.types;
67135
- const include = types.map((t) => t.flags & 402784252 /* Primitive */ || getReducedType(t).flags & 131072 /* Never */ ? 0 /* False */ : -1 /* True */);
67148
+ const include = types.map((t) => t.flags & 402784252 /* Primitive */ ? 0 /* False */ : -1 /* True */);
67136
67149
  for (const [getDiscriminatingType, propertyName] of discriminators) {
67137
67150
  let matched = false;
67138
67151
  for (let i = 0; i < types.length; i++) {
@@ -73288,7 +73301,10 @@ function createTypeChecker(host) {
73288
73301
  if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
73289
73302
  const inferenceContext = getInferenceContext(node);
73290
73303
  if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
73291
- return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
73304
+ const type = instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
73305
+ if (!(type.flags & 3 /* AnyOrUnknown */)) {
73306
+ return type;
73307
+ }
73292
73308
  }
73293
73309
  if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
73294
73310
  const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
@@ -78720,7 +78736,7 @@ function createTypeChecker(host) {
78720
78736
  const nextTypes = [];
78721
78737
  const isAsync = (getFunctionFlags(func) & 2 /* Async */) !== 0;
78722
78738
  forEachYieldExpression(func.body, (yieldExpression) => {
78723
- const yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType;
78739
+ const yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode && checkMode & ~8 /* SkipGenericFunctions */) : undefinedWideningType;
78724
78740
  pushIfUnique(yieldTypes, getYieldedTypeOfYieldExpression(yieldExpression, yieldExpressionType, anyType, isAsync));
78725
78741
  let nextType;
78726
78742
  if (yieldExpression.asteriskToken) {
package/lib/typescript.js CHANGED
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
2285
2285
 
2286
2286
  // src/compiler/corePublic.ts
2287
2287
  var versionMajorMinor = "6.0";
2288
- var version = `${versionMajorMinor}.0-insiders.20250812`;
2288
+ var version = `${versionMajorMinor}.0-insiders.20250813`;
2289
2289
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2290
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2291
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -17952,12 +17952,15 @@ function forEachYieldExpression(body, visitor) {
17952
17952
  function traverse(node) {
17953
17953
  switch (node.kind) {
17954
17954
  case 230 /* YieldExpression */:
17955
- visitor(node);
17955
+ const value = visitor(node);
17956
+ if (value) {
17957
+ return value;
17958
+ }
17956
17959
  const operand = node.expression;
17957
- if (operand) {
17958
- traverse(operand);
17960
+ if (!operand) {
17961
+ return;
17959
17962
  }
17960
- return;
17963
+ return traverse(operand);
17961
17964
  case 267 /* EnumDeclaration */:
17962
17965
  case 265 /* InterfaceDeclaration */:
17963
17966
  case 268 /* ModuleDeclaration */:
@@ -17966,11 +17969,10 @@ function forEachYieldExpression(body, visitor) {
17966
17969
  default:
17967
17970
  if (isFunctionLike(node)) {
17968
17971
  if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
17969
- traverse(node.name.expression);
17970
- return;
17972
+ return traverse(node.name.expression);
17971
17973
  }
17972
17974
  } else if (!isPartOfTypeNode(node)) {
17973
- forEachChild(node, traverse);
17975
+ return forEachChild(node, traverse);
17974
17976
  }
17975
17977
  }
17976
17978
  }
@@ -23121,7 +23123,7 @@ function hasContextSensitiveParameters(node) {
23121
23123
  if (node.kind !== 220 /* ArrowFunction */) {
23122
23124
  const parameter = firstOrUndefined(node.parameters);
23123
23125
  if (!(parameter && parameterIsThisKeyword(parameter))) {
23124
- return true;
23126
+ return !!(node.flags & 256 /* ContainsThis */);
23125
23127
  }
23126
23128
  }
23127
23129
  }
@@ -47155,6 +47157,7 @@ function createBinder() {
47155
47157
  const saveExceptionTarget = currentExceptionTarget;
47156
47158
  const saveActiveLabelList = activeLabelList;
47157
47159
  const saveHasExplicitReturn = hasExplicitReturn;
47160
+ const saveSeenThisKeyword = seenThisKeyword;
47158
47161
  const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
47159
47162
  if (!isImmediatelyInvoked) {
47160
47163
  currentFlow = createFlowNode(
@@ -47174,13 +47177,17 @@ function createBinder() {
47174
47177
  currentContinueTarget = void 0;
47175
47178
  activeLabelList = void 0;
47176
47179
  hasExplicitReturn = false;
47180
+ seenThisKeyword = false;
47177
47181
  bindChildren(node);
47178
- node.flags &= ~5632 /* ReachabilityAndEmitFlags */;
47182
+ node.flags &= ~(5632 /* ReachabilityAndEmitFlags */ | 256 /* ContainsThis */);
47179
47183
  if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
47180
47184
  node.flags |= 512 /* HasImplicitReturn */;
47181
47185
  if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
47182
47186
  node.endFlowNode = currentFlow;
47183
47187
  }
47188
+ if (seenThisKeyword) {
47189
+ node.flags |= 256 /* ContainsThis */;
47190
+ }
47184
47191
  if (node.kind === 308 /* SourceFile */) {
47185
47192
  node.flags |= emitFlags;
47186
47193
  node.endFlowNode = currentFlow;
@@ -47201,11 +47208,14 @@ function createBinder() {
47201
47208
  currentExceptionTarget = saveExceptionTarget;
47202
47209
  activeLabelList = saveActiveLabelList;
47203
47210
  hasExplicitReturn = saveHasExplicitReturn;
47211
+ seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
47204
47212
  } else if (containerFlags & 64 /* IsInterface */) {
47213
+ const saveSeenThisKeyword = seenThisKeyword;
47205
47214
  seenThisKeyword = false;
47206
47215
  bindChildren(node);
47207
47216
  Debug.assertNotNode(node, isIdentifier);
47208
47217
  node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
47218
+ seenThisKeyword = saveSeenThisKeyword;
47209
47219
  } else {
47210
47220
  bindChildren(node);
47211
47221
  }
@@ -48693,6 +48703,9 @@ function createBinder() {
48693
48703
  }
48694
48704
  // falls through
48695
48705
  case 110 /* ThisKeyword */:
48706
+ if (node.kind === 110 /* ThisKeyword */) {
48707
+ seenThisKeyword = true;
48708
+ }
48696
48709
  if (currentFlow && (isExpression(node) || parent2.kind === 305 /* ShorthandPropertyAssignment */)) {
48697
48710
  node.flowNode = currentFlow;
48698
48711
  }
@@ -49615,6 +49628,8 @@ function getContainerFlags(node) {
49615
49628
  // falls through
49616
49629
  case 177 /* Constructor */:
49617
49630
  case 263 /* FunctionDeclaration */:
49631
+ case 176 /* ClassStaticBlockDeclaration */:
49632
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49618
49633
  case 174 /* MethodSignature */:
49619
49634
  case 180 /* CallSignature */:
49620
49635
  case 324 /* JSDocSignature */:
@@ -49622,17 +49637,14 @@ function getContainerFlags(node) {
49622
49637
  case 185 /* FunctionType */:
49623
49638
  case 181 /* ConstructSignature */:
49624
49639
  case 186 /* ConstructorType */:
49625
- case 176 /* ClassStaticBlockDeclaration */:
49626
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49640
+ return 1 /* IsContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49627
49641
  case 352 /* JSDocImportTag */:
49628
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
49642
+ return 1 /* IsContainer */ | 32 /* HasLocals */;
49629
49643
  case 219 /* FunctionExpression */:
49630
49644
  case 220 /* ArrowFunction */:
49631
49645
  return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
49632
49646
  case 269 /* ModuleBlock */:
49633
49647
  return 4 /* IsControlFlowContainer */;
49634
- case 173 /* PropertyDeclaration */:
49635
- return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
49636
49648
  case 300 /* CatchClause */:
49637
49649
  case 249 /* ForStatement */:
49638
49650
  case 250 /* ForInStatement */:
@@ -68346,7 +68358,8 @@ function createTypeChecker(host) {
68346
68358
  const { initializer } = node;
68347
68359
  return !!initializer && isContextSensitive(initializer);
68348
68360
  }
68349
- case 295 /* JsxExpression */: {
68361
+ case 295 /* JsxExpression */:
68362
+ case 230 /* YieldExpression */: {
68350
68363
  const { expression } = node;
68351
68364
  return !!expression && isContextSensitive(expression);
68352
68365
  }
@@ -68354,7 +68367,7 @@ function createTypeChecker(host) {
68354
68367
  return false;
68355
68368
  }
68356
68369
  function isContextSensitiveFunctionLikeDeclaration(node) {
68357
- return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
68370
+ return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node) || !!(getFunctionFlags(node) & 1 /* Generator */ && node.body && forEachYieldExpression(node.body, isContextSensitive));
68358
68371
  }
68359
68372
  function hasContextSensitiveReturnExpression(node) {
68360
68373
  if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
@@ -71740,7 +71753,7 @@ function createTypeChecker(host) {
71740
71753
  }
71741
71754
  function discriminateTypeByDiscriminableItems(target, discriminators, related) {
71742
71755
  const types = target.types;
71743
- const include = types.map((t) => t.flags & 402784252 /* Primitive */ || getReducedType(t).flags & 131072 /* Never */ ? 0 /* False */ : -1 /* True */);
71756
+ const include = types.map((t) => t.flags & 402784252 /* Primitive */ ? 0 /* False */ : -1 /* True */);
71744
71757
  for (const [getDiscriminatingType, propertyName] of discriminators) {
71745
71758
  let matched = false;
71746
71759
  for (let i = 0; i < types.length; i++) {
@@ -77896,7 +77909,10 @@ function createTypeChecker(host) {
77896
77909
  if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
77897
77910
  const inferenceContext = getInferenceContext(node);
77898
77911
  if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
77899
- return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
77912
+ const type = instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
77913
+ if (!(type.flags & 3 /* AnyOrUnknown */)) {
77914
+ return type;
77915
+ }
77900
77916
  }
77901
77917
  if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
77902
77918
  const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
@@ -83328,7 +83344,7 @@ function createTypeChecker(host) {
83328
83344
  const nextTypes = [];
83329
83345
  const isAsync = (getFunctionFlags(func) & 2 /* Async */) !== 0;
83330
83346
  forEachYieldExpression(func.body, (yieldExpression) => {
83331
- const yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType;
83347
+ const yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode && checkMode & ~8 /* SkipGenericFunctions */) : undefinedWideningType;
83332
83348
  pushIfUnique(yieldTypes, getYieldedTypeOfYieldExpression(yieldExpression, yieldExpressionType, anyType, isAsync));
83333
83349
  let nextType;
83334
83350
  if (yieldExpression.asteriskToken) {
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": "6.0.0-pr-62275-3",
5
+ "version": "6.0.0-pr-62243-25",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [