typescript 6.0.0-dev.20251210 → 6.0.0-dev.20251212

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-dev.20251210`;
21
+ var version = `${versionMajorMinor}.0-dev.20251212`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6221,18 +6221,7 @@ var Diagnostics = {
6221
6221
  Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class: diag(1537, 1 /* Error */, "Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537", "Decimal escape sequences and backreferences are not allowed in a character class."),
6222
6222
  Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: diag(1538, 1 /* Error */, "Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538", "Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),
6223
6223
  A_bigint_literal_cannot_be_used_as_a_property_name: diag(1539, 1 /* Error */, "A_bigint_literal_cannot_be_used_as_a_property_name_1539", "A 'bigint' literal cannot be used as a property name."),
6224
- A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead: diag(
6225
- 1540,
6226
- 2 /* Suggestion */,
6227
- "A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540",
6228
- "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",
6229
- /*reportsUnnecessary*/
6230
- void 0,
6231
- /*elidedInCompatabilityPyramid*/
6232
- void 0,
6233
- /*reportsDeprecated*/
6234
- true
6235
- ),
6224
+ A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead: diag(1540, 1 /* Error */, "A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540", "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead."),
6236
6225
  Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute: diag(1541, 1 /* Error */, "Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribut_1541", "Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),
6237
6226
  Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute: diag(1542, 1 /* Error */, "Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute_1542", "Type import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),
6238
6227
  Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0: diag(1543, 1 /* Error */, "Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_mod_1543", `Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to '{0}'.`),
@@ -13019,13 +13008,6 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
13019
13008
  isInJSDoc(node)
13020
13009
  );
13021
13010
  }
13022
- function getNonModifierTokenPosOfNode(node, sourceFile) {
13023
- const lastModifier = !nodeIsMissing(node) && canHaveModifiers(node) && node.modifiers ? last(node.modifiers) : void 0;
13024
- if (!lastModifier) {
13025
- return getTokenPosOfNode(node, sourceFile);
13026
- }
13027
- return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastModifier.end);
13028
- }
13029
13011
  function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia = false) {
13030
13012
  return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia);
13031
13013
  }
@@ -14267,12 +14249,15 @@ function forEachYieldExpression(body, visitor) {
14267
14249
  function traverse(node) {
14268
14250
  switch (node.kind) {
14269
14251
  case 230 /* YieldExpression */:
14270
- visitor(node);
14252
+ const value = visitor(node);
14253
+ if (value) {
14254
+ return value;
14255
+ }
14271
14256
  const operand = node.expression;
14272
- if (operand) {
14273
- traverse(operand);
14257
+ if (!operand) {
14258
+ return;
14274
14259
  }
14275
- return;
14260
+ return traverse(operand);
14276
14261
  case 267 /* EnumDeclaration */:
14277
14262
  case 265 /* InterfaceDeclaration */:
14278
14263
  case 268 /* ModuleDeclaration */:
@@ -14281,11 +14266,10 @@ function forEachYieldExpression(body, visitor) {
14281
14266
  default:
14282
14267
  if (isFunctionLike(node)) {
14283
14268
  if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
14284
- traverse(node.name.expression);
14285
- return;
14269
+ return traverse(node.name.expression);
14286
14270
  }
14287
14271
  } else if (!isPartOfTypeNode(node)) {
14288
- forEachChild(node, traverse);
14272
+ return forEachChild(node, traverse);
14289
14273
  }
14290
14274
  }
14291
14275
  }
@@ -19129,7 +19113,7 @@ function hasContextSensitiveParameters(node) {
19129
19113
  if (node.kind !== 220 /* ArrowFunction */) {
19130
19114
  const parameter = firstOrUndefined(node.parameters);
19131
19115
  if (!(parameter && parameterIsThisKeyword(parameter))) {
19132
- return true;
19116
+ return !!(node.flags & 256 /* ContainsThis */);
19133
19117
  }
19134
19118
  }
19135
19119
  }
@@ -42683,6 +42667,7 @@ function createBinder() {
42683
42667
  const saveExceptionTarget = currentExceptionTarget;
42684
42668
  const saveActiveLabelList = activeLabelList;
42685
42669
  const saveHasExplicitReturn = hasExplicitReturn;
42670
+ const saveSeenThisKeyword = seenThisKeyword;
42686
42671
  const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
42687
42672
  if (!isImmediatelyInvoked) {
42688
42673
  currentFlow = createFlowNode(
@@ -42702,13 +42687,17 @@ function createBinder() {
42702
42687
  currentContinueTarget = void 0;
42703
42688
  activeLabelList = void 0;
42704
42689
  hasExplicitReturn = false;
42690
+ seenThisKeyword = false;
42705
42691
  bindChildren(node);
42706
- node.flags &= ~5632 /* ReachabilityAndEmitFlags */;
42692
+ node.flags &= ~(5632 /* ReachabilityAndEmitFlags */ | 256 /* ContainsThis */);
42707
42693
  if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
42708
42694
  node.flags |= 512 /* HasImplicitReturn */;
42709
42695
  if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
42710
42696
  node.endFlowNode = currentFlow;
42711
42697
  }
42698
+ if (seenThisKeyword) {
42699
+ node.flags |= 256 /* ContainsThis */;
42700
+ }
42712
42701
  if (node.kind === 308 /* SourceFile */) {
42713
42702
  node.flags |= emitFlags;
42714
42703
  node.endFlowNode = currentFlow;
@@ -42729,11 +42718,14 @@ function createBinder() {
42729
42718
  currentExceptionTarget = saveExceptionTarget;
42730
42719
  activeLabelList = saveActiveLabelList;
42731
42720
  hasExplicitReturn = saveHasExplicitReturn;
42721
+ seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
42732
42722
  } else if (containerFlags & 64 /* IsInterface */) {
42723
+ const saveSeenThisKeyword = seenThisKeyword;
42733
42724
  seenThisKeyword = false;
42734
42725
  bindChildren(node);
42735
42726
  Debug.assertNotNode(node, isIdentifier);
42736
42727
  node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
42728
+ seenThisKeyword = saveSeenThisKeyword;
42737
42729
  } else {
42738
42730
  bindChildren(node);
42739
42731
  }
@@ -44213,6 +44205,9 @@ function createBinder() {
44213
44205
  }
44214
44206
  // falls through
44215
44207
  case 110 /* ThisKeyword */:
44208
+ if (node.kind === 110 /* ThisKeyword */) {
44209
+ seenThisKeyword = true;
44210
+ }
44216
44211
  if (currentFlow && (isExpression(node) || parent.kind === 305 /* ShorthandPropertyAssignment */)) {
44217
44212
  node.flowNode = currentFlow;
44218
44213
  }
@@ -45080,6 +45075,8 @@ function getContainerFlags(node) {
45080
45075
  // falls through
45081
45076
  case 177 /* Constructor */:
45082
45077
  case 263 /* FunctionDeclaration */:
45078
+ case 176 /* ClassStaticBlockDeclaration */:
45079
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
45083
45080
  case 174 /* MethodSignature */:
45084
45081
  case 180 /* CallSignature */:
45085
45082
  case 324 /* JSDocSignature */:
@@ -45087,17 +45084,14 @@ function getContainerFlags(node) {
45087
45084
  case 185 /* FunctionType */:
45088
45085
  case 181 /* ConstructSignature */:
45089
45086
  case 186 /* ConstructorType */:
45090
- case 176 /* ClassStaticBlockDeclaration */:
45091
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
45087
+ return 1 /* IsContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
45092
45088
  case 352 /* JSDocImportTag */:
45093
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
45089
+ return 1 /* IsContainer */ | 32 /* HasLocals */;
45094
45090
  case 219 /* FunctionExpression */:
45095
45091
  case 220 /* ArrowFunction */:
45096
45092
  return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
45097
45093
  case 269 /* ModuleBlock */:
45098
45094
  return 4 /* IsControlFlowContainer */;
45099
- case 173 /* PropertyDeclaration */:
45100
- return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
45101
45095
  case 300 /* CatchClause */:
45102
45096
  case 249 /* ForStatement */:
45103
45097
  case 250 /* ForInStatement */:
@@ -63710,7 +63704,8 @@ function createTypeChecker(host) {
63710
63704
  const { initializer } = node;
63711
63705
  return !!initializer && isContextSensitive(initializer);
63712
63706
  }
63713
- case 295 /* JsxExpression */: {
63707
+ case 295 /* JsxExpression */:
63708
+ case 230 /* YieldExpression */: {
63714
63709
  const { expression } = node;
63715
63710
  return !!expression && isContextSensitive(expression);
63716
63711
  }
@@ -63718,7 +63713,7 @@ function createTypeChecker(host) {
63718
63713
  return false;
63719
63714
  }
63720
63715
  function isContextSensitiveFunctionLikeDeclaration(node) {
63721
- return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
63716
+ return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node) || hasContextSensitiveYieldExpression(node);
63722
63717
  }
63723
63718
  function hasContextSensitiveReturnExpression(node) {
63724
63719
  if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
@@ -63729,6 +63724,9 @@ function createTypeChecker(host) {
63729
63724
  }
63730
63725
  return !!forEachReturnStatement(node.body, (statement) => !!statement.expression && isContextSensitive(statement.expression));
63731
63726
  }
63727
+ function hasContextSensitiveYieldExpression(node) {
63728
+ return !!(getFunctionFlags(node) & 1 /* Generator */ && node.body && forEachYieldExpression(node.body, isContextSensitive));
63729
+ }
63732
63730
  function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
63733
63731
  return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
63734
63732
  }
@@ -73276,11 +73274,16 @@ function createTypeChecker(host) {
73276
73274
  if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
73277
73275
  const inferenceContext = getInferenceContext(node);
73278
73276
  if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
73279
- return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
73277
+ const type = instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
73278
+ if (!(type.flags & 3 /* AnyOrUnknown */)) {
73279
+ return type;
73280
+ }
73280
73281
  }
73281
73282
  if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
73282
73283
  const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
73283
- return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ? filterType(type, (t) => t !== regularFalseType && t !== regularTrueType) : type;
73284
+ if (!(type.flags & 3 /* AnyOrUnknown */)) {
73285
+ return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ? filterType(type, (t) => t !== regularFalseType && t !== regularTrueType) : type;
73286
+ }
73284
73287
  }
73285
73288
  }
73286
73289
  return contextualType;
@@ -85709,12 +85712,7 @@ function createTypeChecker(host) {
85709
85712
  if (isIdentifier(node.name)) {
85710
85713
  checkCollisionsForDeclarationName(node, node.name);
85711
85714
  if (!(node.flags & (32 /* Namespace */ | 2048 /* GlobalAugmentation */))) {
85712
- const sourceFile = getSourceFileOfNode(node);
85713
- const pos = getNonModifierTokenPosOfNode(node);
85714
- const span = getSpanOfTokenAtPosition(sourceFile, pos);
85715
- suggestionDiagnostics.add(
85716
- createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead)
85717
- );
85715
+ error(node.name, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead);
85718
85716
  }
85719
85717
  }
85720
85718
  checkExportsOnMergedDeclarations(node);
@@ -22,7 +22,7 @@ interface String {
22
22
  /**
23
23
  * Matches a string with a regular expression, and returns an iterable of matches
24
24
  * containing the results of that search.
25
- * @param regexp A variable name or string literal containing the regular expression pattern and flags.
25
+ * @param regexp A regular expression
26
26
  */
27
27
  matchAll(regexp: RegExp): RegExpStringIterator<RegExpExecArray>;
28
28
 
package/lib/typescript.js CHANGED
@@ -913,7 +913,6 @@ __export(typescript_exports, {
913
913
  getNonAugmentationDeclaration: () => getNonAugmentationDeclaration,
914
914
  getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode,
915
915
  getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots,
916
- getNonModifierTokenPosOfNode: () => getNonModifierTokenPosOfNode,
917
916
  getNormalizedAbsolutePath: () => getNormalizedAbsolutePath,
918
917
  getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot,
919
918
  getNormalizedPathComponents: () => getNormalizedPathComponents,
@@ -2286,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
2286
2285
 
2287
2286
  // src/compiler/corePublic.ts
2288
2287
  var versionMajorMinor = "6.0";
2289
- var version = `${versionMajorMinor}.0-dev.20251210`;
2288
+ var version = `${versionMajorMinor}.0-dev.20251212`;
2290
2289
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2291
2290
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2292
2291
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9622,18 +9621,7 @@ var Diagnostics = {
9622
9621
  Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class: diag(1537, 1 /* Error */, "Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537", "Decimal escape sequences and backreferences are not allowed in a character class."),
9623
9622
  Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: diag(1538, 1 /* Error */, "Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538", "Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),
9624
9623
  A_bigint_literal_cannot_be_used_as_a_property_name: diag(1539, 1 /* Error */, "A_bigint_literal_cannot_be_used_as_a_property_name_1539", "A 'bigint' literal cannot be used as a property name."),
9625
- A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead: diag(
9626
- 1540,
9627
- 2 /* Suggestion */,
9628
- "A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540",
9629
- "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",
9630
- /*reportsUnnecessary*/
9631
- void 0,
9632
- /*elidedInCompatabilityPyramid*/
9633
- void 0,
9634
- /*reportsDeprecated*/
9635
- true
9636
- ),
9624
+ A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead: diag(1540, 1 /* Error */, "A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540", "A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead."),
9637
9625
  Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute: diag(1541, 1 /* Error */, "Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribut_1541", "Type-only import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),
9638
9626
  Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute: diag(1542, 1 /* Error */, "Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute_1542", "Type import of an ECMAScript module from a CommonJS module must have a 'resolution-mode' attribute."),
9639
9627
  Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_module_is_set_to_0: diag(1543, 1 /* Error */, "Importing_a_JSON_file_into_an_ECMAScript_module_requires_a_type_Colon_json_import_attribute_when_mod_1543", `Importing a JSON file into an ECMAScript module requires a 'type: "json"' import attribute when 'module' is set to '{0}'.`),
@@ -16667,13 +16655,6 @@ function getNonDecoratorTokenPosOfNode(node, sourceFile) {
16667
16655
  }
16668
16656
  return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastDecorator.end);
16669
16657
  }
16670
- function getNonModifierTokenPosOfNode(node, sourceFile) {
16671
- const lastModifier = !nodeIsMissing(node) && canHaveModifiers(node) && node.modifiers ? last(node.modifiers) : void 0;
16672
- if (!lastModifier) {
16673
- return getTokenPosOfNode(node, sourceFile);
16674
- }
16675
- return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastModifier.end);
16676
- }
16677
16658
  function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia = false) {
16678
16659
  return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia);
16679
16660
  }
@@ -17972,12 +17953,15 @@ function forEachYieldExpression(body, visitor) {
17972
17953
  function traverse(node) {
17973
17954
  switch (node.kind) {
17974
17955
  case 230 /* YieldExpression */:
17975
- visitor(node);
17956
+ const value = visitor(node);
17957
+ if (value) {
17958
+ return value;
17959
+ }
17976
17960
  const operand = node.expression;
17977
- if (operand) {
17978
- traverse(operand);
17961
+ if (!operand) {
17962
+ return;
17979
17963
  }
17980
- return;
17964
+ return traverse(operand);
17981
17965
  case 267 /* EnumDeclaration */:
17982
17966
  case 265 /* InterfaceDeclaration */:
17983
17967
  case 268 /* ModuleDeclaration */:
@@ -17986,11 +17970,10 @@ function forEachYieldExpression(body, visitor) {
17986
17970
  default:
17987
17971
  if (isFunctionLike(node)) {
17988
17972
  if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
17989
- traverse(node.name.expression);
17990
- return;
17973
+ return traverse(node.name.expression);
17991
17974
  }
17992
17975
  } else if (!isPartOfTypeNode(node)) {
17993
- forEachChild(node, traverse);
17976
+ return forEachChild(node, traverse);
17994
17977
  }
17995
17978
  }
17996
17979
  }
@@ -23137,7 +23120,7 @@ function hasContextSensitiveParameters(node) {
23137
23120
  if (node.kind !== 220 /* ArrowFunction */) {
23138
23121
  const parameter = firstOrUndefined(node.parameters);
23139
23122
  if (!(parameter && parameterIsThisKeyword(parameter))) {
23140
- return true;
23123
+ return !!(node.flags & 256 /* ContainsThis */);
23141
23124
  }
23142
23125
  }
23143
23126
  }
@@ -47212,6 +47195,7 @@ function createBinder() {
47212
47195
  const saveExceptionTarget = currentExceptionTarget;
47213
47196
  const saveActiveLabelList = activeLabelList;
47214
47197
  const saveHasExplicitReturn = hasExplicitReturn;
47198
+ const saveSeenThisKeyword = seenThisKeyword;
47215
47199
  const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
47216
47200
  if (!isImmediatelyInvoked) {
47217
47201
  currentFlow = createFlowNode(
@@ -47231,13 +47215,17 @@ function createBinder() {
47231
47215
  currentContinueTarget = void 0;
47232
47216
  activeLabelList = void 0;
47233
47217
  hasExplicitReturn = false;
47218
+ seenThisKeyword = false;
47234
47219
  bindChildren(node);
47235
- node.flags &= ~5632 /* ReachabilityAndEmitFlags */;
47220
+ node.flags &= ~(5632 /* ReachabilityAndEmitFlags */ | 256 /* ContainsThis */);
47236
47221
  if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
47237
47222
  node.flags |= 512 /* HasImplicitReturn */;
47238
47223
  if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
47239
47224
  node.endFlowNode = currentFlow;
47240
47225
  }
47226
+ if (seenThisKeyword) {
47227
+ node.flags |= 256 /* ContainsThis */;
47228
+ }
47241
47229
  if (node.kind === 308 /* SourceFile */) {
47242
47230
  node.flags |= emitFlags;
47243
47231
  node.endFlowNode = currentFlow;
@@ -47258,11 +47246,14 @@ function createBinder() {
47258
47246
  currentExceptionTarget = saveExceptionTarget;
47259
47247
  activeLabelList = saveActiveLabelList;
47260
47248
  hasExplicitReturn = saveHasExplicitReturn;
47249
+ seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
47261
47250
  } else if (containerFlags & 64 /* IsInterface */) {
47251
+ const saveSeenThisKeyword = seenThisKeyword;
47262
47252
  seenThisKeyword = false;
47263
47253
  bindChildren(node);
47264
47254
  Debug.assertNotNode(node, isIdentifier);
47265
47255
  node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
47256
+ seenThisKeyword = saveSeenThisKeyword;
47266
47257
  } else {
47267
47258
  bindChildren(node);
47268
47259
  }
@@ -48742,6 +48733,9 @@ function createBinder() {
48742
48733
  }
48743
48734
  // falls through
48744
48735
  case 110 /* ThisKeyword */:
48736
+ if (node.kind === 110 /* ThisKeyword */) {
48737
+ seenThisKeyword = true;
48738
+ }
48745
48739
  if (currentFlow && (isExpression(node) || parent2.kind === 305 /* ShorthandPropertyAssignment */)) {
48746
48740
  node.flowNode = currentFlow;
48747
48741
  }
@@ -49609,6 +49603,8 @@ function getContainerFlags(node) {
49609
49603
  // falls through
49610
49604
  case 177 /* Constructor */:
49611
49605
  case 263 /* FunctionDeclaration */:
49606
+ case 176 /* ClassStaticBlockDeclaration */:
49607
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49612
49608
  case 174 /* MethodSignature */:
49613
49609
  case 180 /* CallSignature */:
49614
49610
  case 324 /* JSDocSignature */:
@@ -49616,17 +49612,14 @@ function getContainerFlags(node) {
49616
49612
  case 185 /* FunctionType */:
49617
49613
  case 181 /* ConstructSignature */:
49618
49614
  case 186 /* ConstructorType */:
49619
- case 176 /* ClassStaticBlockDeclaration */:
49620
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49615
+ return 1 /* IsContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49621
49616
  case 352 /* JSDocImportTag */:
49622
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
49617
+ return 1 /* IsContainer */ | 32 /* HasLocals */;
49623
49618
  case 219 /* FunctionExpression */:
49624
49619
  case 220 /* ArrowFunction */:
49625
49620
  return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
49626
49621
  case 269 /* ModuleBlock */:
49627
49622
  return 4 /* IsControlFlowContainer */;
49628
- case 173 /* PropertyDeclaration */:
49629
- return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
49630
49623
  case 300 /* CatchClause */:
49631
49624
  case 249 /* ForStatement */:
49632
49625
  case 250 /* ForInStatement */:
@@ -68339,7 +68332,8 @@ function createTypeChecker(host) {
68339
68332
  const { initializer } = node;
68340
68333
  return !!initializer && isContextSensitive(initializer);
68341
68334
  }
68342
- case 295 /* JsxExpression */: {
68335
+ case 295 /* JsxExpression */:
68336
+ case 230 /* YieldExpression */: {
68343
68337
  const { expression } = node;
68344
68338
  return !!expression && isContextSensitive(expression);
68345
68339
  }
@@ -68347,7 +68341,7 @@ function createTypeChecker(host) {
68347
68341
  return false;
68348
68342
  }
68349
68343
  function isContextSensitiveFunctionLikeDeclaration(node) {
68350
- return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
68344
+ return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node) || hasContextSensitiveYieldExpression(node);
68351
68345
  }
68352
68346
  function hasContextSensitiveReturnExpression(node) {
68353
68347
  if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
@@ -68358,6 +68352,9 @@ function createTypeChecker(host) {
68358
68352
  }
68359
68353
  return !!forEachReturnStatement(node.body, (statement) => !!statement.expression && isContextSensitive(statement.expression));
68360
68354
  }
68355
+ function hasContextSensitiveYieldExpression(node) {
68356
+ return !!(getFunctionFlags(node) & 1 /* Generator */ && node.body && forEachYieldExpression(node.body, isContextSensitive));
68357
+ }
68361
68358
  function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
68362
68359
  return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
68363
68360
  }
@@ -77905,11 +77902,16 @@ function createTypeChecker(host) {
77905
77902
  if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
77906
77903
  const inferenceContext = getInferenceContext(node);
77907
77904
  if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
77908
- return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
77905
+ const type = instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
77906
+ if (!(type.flags & 3 /* AnyOrUnknown */)) {
77907
+ return type;
77908
+ }
77909
77909
  }
77910
77910
  if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
77911
77911
  const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
77912
- return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ? filterType(type, (t) => t !== regularFalseType && t !== regularTrueType) : type;
77912
+ if (!(type.flags & 3 /* AnyOrUnknown */)) {
77913
+ return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ? filterType(type, (t) => t !== regularFalseType && t !== regularTrueType) : type;
77914
+ }
77913
77915
  }
77914
77916
  }
77915
77917
  return contextualType;
@@ -90338,12 +90340,7 @@ function createTypeChecker(host) {
90338
90340
  if (isIdentifier(node.name)) {
90339
90341
  checkCollisionsForDeclarationName(node, node.name);
90340
90342
  if (!(node.flags & (32 /* Namespace */ | 2048 /* GlobalAugmentation */))) {
90341
- const sourceFile = getSourceFileOfNode(node);
90342
- const pos = getNonModifierTokenPosOfNode(node);
90343
- const span = getSpanOfTokenAtPosition(sourceFile, pos);
90344
- suggestionDiagnostics.add(
90345
- createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead)
90346
- );
90343
+ error2(node.name, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead);
90347
90344
  }
90348
90345
  }
90349
90346
  checkExportsOnMergedDeclarations(node);
@@ -184294,7 +184291,6 @@ __export(ts_exports2, {
184294
184291
  getNonAugmentationDeclaration: () => getNonAugmentationDeclaration,
184295
184292
  getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode,
184296
184293
  getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots,
184297
- getNonModifierTokenPosOfNode: () => getNonModifierTokenPosOfNode,
184298
184294
  getNormalizedAbsolutePath: () => getNormalizedAbsolutePath,
184299
184295
  getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot,
184300
184296
  getNormalizedPathComponents: () => getNormalizedPathComponents,
@@ -199056,7 +199052,6 @@ if (typeof console !== "undefined") {
199056
199052
  getNonAugmentationDeclaration,
199057
199053
  getNonDecoratorTokenPosOfNode,
199058
199054
  getNonIncrementalBuildInfoRoots,
199059
- getNonModifierTokenPosOfNode,
199060
199055
  getNormalizedAbsolutePath,
199061
199056
  getNormalizedAbsolutePathWithoutRoot,
199062
199057
  getNormalizedPathComponents,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "6.0.0-dev.20251210",
5
+ "version": "6.0.0-dev.20251212",
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": "1da8266179589bbc977ccbd8712614ed5ddd3004"
118
+ "gitHead": "16b933fb7bff04371fe9ec8525a8e90afa3174d4"
119
119
  }