@typescript-deploys/pr-build 5.2.0-pr-54546-4 → 5.2.0-pr-54281-18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.2";
21
- var version = `${versionMajorMinor}.0-insiders.20230605`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230607`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -5986,6 +5986,8 @@ var Diagnostics = {
5986
5986
  Class_constructor_may_not_be_a_generator: diag(1368, 1 /* Error */, "Class_constructor_may_not_be_a_generator_1368", "Class constructor may not be a generator."),
5987
5987
  Did_you_mean_0: diag(1369, 3 /* Message */, "Did_you_mean_0_1369", "Did you mean '{0}'?"),
5988
5988
  This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error: diag(1371, 1 /* Error */, "This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371", "This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),
5989
+ Convert_to_type_only_import: diag(1373, 3 /* Message */, "Convert_to_type_only_import_1373", "Convert to type-only import"),
5990
+ Convert_all_imports_not_used_as_a_value_to_type_only_imports: diag(1374, 3 /* Message */, "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374", "Convert all imports not used as a value to type-only imports"),
5989
5991
  await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1 /* Error */, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
5990
5992
  _0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."),
5991
5993
  _0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."),
@@ -6138,7 +6140,6 @@ var Diagnostics = {
6138
6140
  The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
6139
6141
  Add_extends_constraint: diag(2211, 3 /* Message */, "Add_extends_constraint_2211", "Add `extends` constraint."),
6140
6142
  Add_extends_constraint_to_all_type_parameters: diag(2212, 3 /* Message */, "Add_extends_constraint_to_all_type_parameters_2212", "Add `extends` constraint to all type parameters"),
6141
- The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2213, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supp_2213", "The project root is ambiguous, but is required to determine the module format of output '.js' files. Supply the `rootDir` compiler option to disambiguate."),
6142
6143
  Duplicate_identifier_0: diag(2300, 1 /* Error */, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
6143
6144
  Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, 1 /* Error */, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
6144
6145
  Static_members_cannot_reference_class_type_parameters: diag(2302, 1 /* Error */, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
@@ -7192,8 +7193,6 @@ var Diagnostics = {
7192
7193
  Resolved_under_condition_0: diag(6414, 3 /* Message */, "Resolved_under_condition_0_6414", "Resolved under condition '{0}'."),
7193
7194
  Failed_to_resolve_under_condition_0: diag(6415, 3 /* Message */, "Failed_to_resolve_under_condition_0_6415", "Failed to resolve under condition '{0}'."),
7194
7195
  Exiting_conditional_exports: diag(6416, 3 /* Message */, "Exiting_conditional_exports_6416", "Exiting conditional exports."),
7195
- Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0: diag(6417, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417", "Searching all ancestor node_modules directories for preferred extensions: {0}."),
7196
- Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: diag(6418, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."),
7197
7196
  The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
7198
7197
  The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
7199
7198
  The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
@@ -7706,9 +7705,9 @@ var Diagnostics = {
7706
7705
  Convert_all_typedef_to_TypeScript_types: diag(95177, 3 /* Message */, "Convert_all_typedef_to_TypeScript_types_95177", "Convert all typedef to TypeScript types."),
7707
7706
  Move_to_file: diag(95178, 3 /* Message */, "Move_to_file_95178", "Move to file"),
7708
7707
  Cannot_move_to_file_selected_file_is_invalid: diag(95179, 3 /* Message */, "Cannot_move_to_file_selected_file_is_invalid_95179", "Cannot move to file, selected file is invalid"),
7709
- Use_import_type: diag(95180, 3 /* Message */, "Use_import_type_95180", "Use 'import type'"),
7710
- Use_type_0: diag(95181, 3 /* Message */, "Use_type_0_95181", "Use 'type {0}'"),
7711
- Fix_all_with_type_only_imports: diag(95182, 3 /* Message */, "Fix_all_with_type_only_imports_95182", "Fix all with type-only imports"),
7708
+ Inline_variable: diag(95180, 3 /* Message */, "Inline_variable_95180", "Inline variable"),
7709
+ Could_not_find_variable_to_inline: diag(95181, 3 /* Message */, "Could_not_find_variable_to_inline_95181", "Could not find variable to inline."),
7710
+ Variables_that_share_a_name_with_a_type_or_namespace_in_the_same_scope_cannot_be_inlined: diag(95182, 3 /* Message */, "Variables_that_share_a_name_with_a_type_or_namespace_in_the_same_scope_cannot_be_inlined_95182", "Variables that share a name with a type or namespace in the same scope cannot be inlined."),
7712
7711
  No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
7713
7712
  Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
7714
7713
  JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
@@ -38487,13 +38486,11 @@ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName,
38487
38486
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
38488
38487
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
38489
38488
  if (priorityExtensions) {
38490
- traceIfEnabled(state, Diagnostics.Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0, formatExtensions(priorityExtensions));
38491
38489
  const result = lookup(priorityExtensions);
38492
38490
  if (result)
38493
38491
  return result;
38494
38492
  }
38495
38493
  if (secondaryExtensions && !typesScopeOnly) {
38496
- traceIfEnabled(state, Diagnostics.Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0, formatExtensions(secondaryExtensions));
38497
38494
  return lookup(secondaryExtensions);
38498
38495
  }
38499
38496
  function lookup(extensions2) {
@@ -42659,11 +42656,10 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
42659
42656
  CheckMode3[CheckMode3["Inferential"] = 2] = "Inferential";
42660
42657
  CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive";
42661
42658
  CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions";
42662
- CheckMode3[CheckMode3["SkipAddingIntraExpressionSites"] = 16] = "SkipAddingIntraExpressionSites";
42663
- CheckMode3[CheckMode3["IsForSignatureHelp"] = 32] = "IsForSignatureHelp";
42664
- CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 64] = "IsForStringLiteralArgumentCompletions";
42665
- CheckMode3[CheckMode3["RestBindingElement"] = 128] = "RestBindingElement";
42666
- CheckMode3[CheckMode3["TypeOnly"] = 256] = "TypeOnly";
42659
+ CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
42660
+ CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
42661
+ CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
42662
+ CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
42667
42663
  return CheckMode3;
42668
42664
  })(CheckMode || {});
42669
42665
  var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
@@ -42943,9 +42939,9 @@ function createTypeChecker(host) {
42943
42939
  candidatesOutArray,
42944
42940
  /*argumentCount*/
42945
42941
  void 0,
42946
- 64 /* IsForStringLiteralArgumentCompletions */
42942
+ 32 /* IsForStringLiteralArgumentCompletions */
42947
42943
  )),
42948
- getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 32 /* IsForSignatureHelp */)),
42944
+ getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
42949
42945
  getExpandedParameters,
42950
42946
  hasEffectiveRestParameter,
42951
42947
  containsArgumentsReference,
@@ -50900,7 +50896,7 @@ function createTypeChecker(host) {
50900
50896
  return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
50901
50897
  }
50902
50898
  function getTypeForBindingElement(declaration) {
50903
- const checkMode = declaration.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */;
50899
+ const checkMode = declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */;
50904
50900
  const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
50905
50901
  return parentType && getBindingElementTypeFromParentType(declaration, parentType);
50906
50902
  }
@@ -58098,10 +58094,7 @@ function createTypeChecker(host) {
58098
58094
  const newMapper = createTypeMapper(typeParameters, typeArguments);
58099
58095
  result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
58100
58096
  if (result.flags & 138117121 /* ObjectFlagsType */ && !(result.objectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
58101
- const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
58102
- if (!(result.objectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
58103
- result.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariables */ : 0);
58104
- }
58097
+ result.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (some(typeArguments, couldContainTypeVariables) ? 1048576 /* CouldContainTypeVariables */ : 0);
58105
58098
  }
58106
58099
  target.instantiations.set(id, result);
58107
58100
  }
@@ -64724,8 +64717,6 @@ function createTypeChecker(host) {
64724
64717
  }
64725
64718
  function isConstantReference(node) {
64726
64719
  switch (node.kind) {
64727
- case 110 /* ThisKeyword */:
64728
- return true;
64729
64720
  case 80 /* Identifier */:
64730
64721
  if (!isThisInTypeQuery(node)) {
64731
64722
  const symbol = getResolvedSymbol(node);
@@ -65800,7 +65791,7 @@ function createTypeChecker(host) {
65800
65791
  return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithoutNullableConstraint) : !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
65801
65792
  }
65802
65793
  function hasContextualTypeWithNoGenericTypes(node, checkMode) {
65803
- const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 128 /* RestBindingElement */ ? getContextualType(node, 8 /* SkipBindingPatterns */) : getContextualType(
65794
+ const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 64 /* RestBindingElement */ ? getContextualType(node, 8 /* SkipBindingPatterns */) : getContextualType(
65804
65795
  node,
65805
65796
  /*contextFlags*/
65806
65797
  void 0
@@ -66557,7 +66548,7 @@ function createTypeChecker(host) {
66557
66548
  function getContextualTypeForBindingElement(declaration, contextFlags) {
66558
66549
  const parent = declaration.parent.parent;
66559
66550
  const name = declaration.propertyName || declaration.name;
66560
- const parentType = getContextualTypeForVariableLikeDeclaration(parent, contextFlags) || parent.kind !== 207 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */);
66551
+ const parentType = getContextualTypeForVariableLikeDeclaration(parent, contextFlags) || parent.kind !== 207 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
66561
66552
  if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name))
66562
66553
  return void 0;
66563
66554
  if (parent.name.kind === 206 /* ArrayBindingPattern */) {
@@ -67606,9 +67597,7 @@ function createTypeChecker(host) {
67606
67597
  elementTypes.push(undefinedOrMissingType);
67607
67598
  elementFlags.push(2 /* Optional */);
67608
67599
  } else {
67609
- const shouldAddAsIntraExpressionInferenceSite = inTupleContext && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && isContextSensitive(e);
67610
- const elementCheckMode = (checkMode || 0 /* Normal */) | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
67611
- const type = checkExpressionForMutableLocation(e, elementCheckMode, forceTuple);
67600
+ const type = checkExpressionForMutableLocation(e, checkMode, forceTuple);
67612
67601
  elementTypes.push(addOptionality(
67613
67602
  type,
67614
67603
  /*isProperty*/
@@ -67616,7 +67605,7 @@ function createTypeChecker(host) {
67616
67605
  hasOmittedExpression
67617
67606
  ));
67618
67607
  elementFlags.push(hasOmittedExpression ? 2 /* Optional */ : 1 /* Required */);
67619
- if (shouldAddAsIntraExpressionInferenceSite) {
67608
+ if (inTupleContext && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(e)) {
67620
67609
  const inferenceContext = getInferenceContext(node);
67621
67610
  Debug.assert(inferenceContext);
67622
67611
  addIntraExpressionInferenceSite(inferenceContext, e, type);
@@ -67757,13 +67746,11 @@ function createTypeChecker(host) {
67757
67746
  let member = getSymbolOfDeclaration(memberDecl);
67758
67747
  const computedNameType = memberDecl.name && memberDecl.name.kind === 166 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
67759
67748
  if (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 303 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
67760
- const shouldAddAsIntraExpressionInferenceSite = contextualType && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 173 /* MethodDeclaration */) && isContextSensitive(memberDecl);
67761
- const propCheckMode = checkMode | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
67762
- let type = memberDecl.kind === 302 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, propCheckMode) : (
67749
+ let type = memberDecl.kind === 302 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : (
67763
67750
  // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring
67764
67751
  // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`.
67765
67752
  // we don't want to say "could not find 'a'".
67766
- memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, propCheckMode) : checkObjectLiteralMethod(memberDecl, propCheckMode)
67753
+ memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode)
67767
67754
  );
67768
67755
  if (isInJavascript) {
67769
67756
  const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
@@ -67807,7 +67794,7 @@ function createTypeChecker(host) {
67807
67794
  prop.links.target = member;
67808
67795
  member = prop;
67809
67796
  allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
67810
- if (shouldAddAsIntraExpressionInferenceSite) {
67797
+ if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 173 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
67811
67798
  const inferenceContext = getInferenceContext(node);
67812
67799
  Debug.assert(inferenceContext);
67813
67800
  const inferenceNode = memberDecl.kind === 302 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
@@ -67980,9 +67967,7 @@ function createTypeChecker(host) {
67980
67967
  for (const attributeDecl of attributes.properties) {
67981
67968
  const member = attributeDecl.symbol;
67982
67969
  if (isJsxAttribute(attributeDecl)) {
67983
- const shouldAddAsIntraExpressionInferenceSite = contextualType && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && isContextSensitive(attributeDecl);
67984
- const attributeCheckMode = checkMode | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
67985
- const exprType = checkJsxAttribute(attributeDecl, attributeCheckMode);
67970
+ const exprType = checkJsxAttribute(attributeDecl, checkMode);
67986
67971
  objectFlags |= getObjectFlags(exprType) & 458752 /* PropagatingFlags */;
67987
67972
  const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
67988
67973
  attributeSymbol.declarations = member.declarations;
@@ -68003,7 +67988,7 @@ function createTypeChecker(host) {
68003
67988
  addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
68004
67989
  }
68005
67990
  }
68006
- if (shouldAddAsIntraExpressionInferenceSite) {
67991
+ if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
68007
67992
  const inferenceContext = getInferenceContext(attributes);
68008
67993
  Debug.assert(inferenceContext);
68009
67994
  const inferenceNode = attributeDecl.initializer.expression;
@@ -69621,7 +69606,7 @@ function createTypeChecker(host) {
69621
69606
  }
69622
69607
  for (let i = 0; i < argCount; i++) {
69623
69608
  const arg = args[i];
69624
- if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 64 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
69609
+ if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
69625
69610
  const paramType = getTypeAtPosition(signature, i);
69626
69611
  if (couldContainTypeVariables(paramType)) {
69627
69612
  const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -70234,12 +70219,12 @@ function createTypeChecker(host) {
70234
70219
  const args = getEffectiveCallArguments(node);
70235
70220
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
70236
70221
  let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
70237
- argCheckMode |= checkMode & 64 /* IsForStringLiteralArgumentCompletions */;
70222
+ argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
70238
70223
  let candidatesForArgumentError;
70239
70224
  let candidateForArgumentArityError;
70240
70225
  let candidateForTypeArgumentError;
70241
70226
  let result;
70242
- const signatureHelpTrailingComma = !!(checkMode & 32 /* IsForSignatureHelp */) && node.kind === 212 /* CallExpression */ && node.arguments.hasTrailingComma;
70227
+ const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 212 /* CallExpression */ && node.arguments.hasTrailingComma;
70243
70228
  if (candidates.length > 1) {
70244
70229
  result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
70245
70230
  }
@@ -70458,7 +70443,7 @@ function createTypeChecker(host) {
70458
70443
  continue;
70459
70444
  }
70460
70445
  if (argCheckMode) {
70461
- argCheckMode = checkMode & 64 /* IsForStringLiteralArgumentCompletions */;
70446
+ argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
70462
70447
  if (inferenceContext) {
70463
70448
  const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
70464
70449
  checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
@@ -73536,7 +73521,7 @@ function createTypeChecker(host) {
73536
73521
  case 36 /* ExclamationEqualsToken */:
73537
73522
  case 37 /* EqualsEqualsEqualsToken */:
73538
73523
  case 38 /* ExclamationEqualsEqualsToken */:
73539
- if (!(checkMode && checkMode & 256 /* TypeOnly */)) {
73524
+ if (!(checkMode && checkMode & 128 /* TypeOnly */)) {
73540
73525
  if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
73541
73526
  const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
73542
73527
  error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
@@ -74195,7 +74180,7 @@ function createTypeChecker(host) {
74195
74180
  }
74196
74181
  }
74197
74182
  const startInvocationCount = flowInvocationCount;
74198
- const type = checkExpression(node, 256 /* TypeOnly */);
74183
+ const type = checkExpression(node, 128 /* TypeOnly */);
74199
74184
  if (flowInvocationCount !== startInvocationCount) {
74200
74185
  const cache = flowTypeCache || (flowTypeCache = []);
74201
74186
  cache[getNodeId(node)] = type;
@@ -76666,7 +76651,7 @@ function createTypeChecker(host) {
76666
76651
  checkComputedPropertyName(node.propertyName);
76667
76652
  }
76668
76653
  const parent = node.parent.parent;
76669
- const parentCheckMode = node.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */;
76654
+ const parentCheckMode = node.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */;
76670
76655
  const parentType = getTypeForBindingElementParent(parent, parentCheckMode);
76671
76656
  const name = node.propertyName || node.name;
76672
76657
  if (parentType && !isBindingPattern(name)) {
@@ -95417,7 +95402,7 @@ function transformJsx(context) {
95417
95402
  continue;
95418
95403
  }
95419
95404
  finishObjectLiteralIfNeeded();
95420
- expressions.push(Debug.checkDefined(visitNode(attr.expression, visitor, isExpression)));
95405
+ expressions.push(attr.expression);
95421
95406
  continue;
95422
95407
  }
95423
95408
  properties.push(transformJsxAttributeToObjectLiteralElement(attr));
@@ -107162,15 +107147,6 @@ function getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, get
107162
107147
  getDeclarationEmitExtensionForPath(inputFileName)
107163
107148
  );
107164
107149
  }
107165
- function getOutputDeclarationFileNameWithoutConfigFile(inputFileName, options, ignoreCase, currentDirectory, getCommonSourceDirectory2) {
107166
- const directory = options.declarationDir || options.outDir ? getNormalizedAbsolutePath(options.declarationDir || options.outDir, currentDirectory) : void 0;
107167
- const outputPathWithoutChangedExtension = directory ? resolvePath(directory, getRelativePathFromDirectory(getCommonSourceDirectory2(), inputFileName, ignoreCase)) : inputFileName;
107168
- const outputFileName = changeExtension(
107169
- outputPathWithoutChangedExtension,
107170
- getDeclarationEmitExtensionForPath(inputFileName)
107171
- );
107172
- return outputFileName;
107173
- }
107174
107150
  function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2) {
107175
107151
  if (configFile.options.emitDeclarationOnly)
107176
107152
  return void 0;
@@ -107181,18 +107157,6 @@ function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSou
107181
107157
  );
107182
107158
  return !isJsonFile || comparePaths(inputFileName, outputFileName, Debug.checkDefined(configFile.options.configFilePath), ignoreCase) !== 0 /* EqualTo */ ? outputFileName : void 0;
107183
107159
  }
107184
- function getOutputJSFileNameWithoutConfigFile(inputFileName, options, ignoreCase, currentDirectory, getCommonSourceDirectory2) {
107185
- if (options.emitDeclarationOnly)
107186
- return void 0;
107187
- const isJsonFile = fileExtensionIs(inputFileName, ".json" /* Json */);
107188
- const outDir = options.outDir ? getNormalizedAbsolutePath(options.outDir, currentDirectory) : void 0;
107189
- const outputPathWithoutChangedExtension = outDir ? resolvePath(outDir, getRelativePathFromDirectory(getCommonSourceDirectory2(), inputFileName, ignoreCase)) : inputFileName;
107190
- const outputFileName = changeExtension(
107191
- outputPathWithoutChangedExtension,
107192
- getOutputExtension(inputFileName, options)
107193
- );
107194
- return !isJsonFile || !options.configFilePath || comparePaths(inputFileName, outputFileName, options.configFilePath, ignoreCase) !== 0 /* EqualTo */ ? outputFileName : void 0;
107195
- }
107196
107160
  function createAddOutput() {
107197
107161
  let outputs;
107198
107162
  return { addOutput, getOutputs };
@@ -113668,15 +113632,6 @@ function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host,
113668
113632
  return { impliedNodeFormat, packageJsonLocations, packageJsonScope };
113669
113633
  }
113670
113634
  }
113671
- function moduleFormatNeedsPackageJsonLookup(fileName, options) {
113672
- switch (getEmitModuleResolutionKind(options)) {
113673
- case 3 /* Node16 */:
113674
- case 99 /* NodeNext */:
113675
- return fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]);
113676
- default:
113677
- return false;
113678
- }
113679
- }
113680
113635
  var plainJSErrors = /* @__PURE__ */ new Set([
113681
113636
  // binder errors
113682
113637
  Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
@@ -113797,7 +113752,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
113797
113752
  let files;
113798
113753
  let symlinks;
113799
113754
  let commonSourceDirectory;
113800
- let assumedCommonSourceDirectory;
113801
113755
  let typeChecker;
113802
113756
  let classifiableNames;
113803
113757
  const ambientModuleNameToUnmodifiedFileName = /* @__PURE__ */ new Map();
@@ -114289,9 +114243,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
114289
114243
  }
114290
114244
  return commonSourceDirectory;
114291
114245
  }
114292
- function getAssumedCommonSourceDirectory() {
114293
- return commonSourceDirectory ?? (assumedCommonSourceDirectory ?? (assumedCommonSourceDirectory = getCommonSourceDirectory(options, () => rootNames, host.getCurrentDirectory(), getCanonicalFileName)));
114294
- }
114295
114246
  function getClassifiableNames() {
114296
114247
  var _a2;
114297
114248
  if (!classifiableNames) {
@@ -114515,7 +114466,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
114515
114466
  })(SeenPackageName || (SeenPackageName = {}));
114516
114467
  const seenPackageNames = /* @__PURE__ */ new Map();
114517
114468
  for (const oldSourceFile of oldSourceFiles) {
114518
- const sourceFileOptions = getCreateSourceFileOptions(oldSourceFile.fileName);
114469
+ const sourceFileOptions = getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options);
114519
114470
  let newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath(
114520
114471
  oldSourceFile.fileName,
114521
114472
  oldSourceFile.resolvedPath,
@@ -115477,48 +115428,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
115477
115428
  (_b2 = tracing) == null ? void 0 : _b2.pop();
115478
115429
  return result;
115479
115430
  }
115480
- function getImpliedNodeFormatForFile(fileName) {
115481
- let fileNameForModuleFormatDetection = getNormalizedAbsolutePath(fileName, currentDirectory);
115482
- if (moduleFormatNeedsPackageJsonLookup(fileName, options)) {
115483
- const projectReference = getResolvedProjectReferenceToRedirect(fileName);
115484
- if (projectReference) {
115485
- Debug.assert(useSourceOfProjectReferenceRedirect);
115486
- fileNameForModuleFormatDetection = getOutputDeclarationFileName(
115487
- fileNameForModuleFormatDetection,
115488
- projectReference.commandLine,
115489
- !host.useCaseSensitiveFileNames()
115490
- ) || getOutputJSFileName(
115491
- fileNameForModuleFormatDetection,
115492
- projectReference.commandLine,
115493
- !host.useCaseSensitiveFileNames()
115494
- ) || fileNameForModuleFormatDetection;
115495
- } else {
115496
- fileNameForModuleFormatDetection = getOutputDeclarationFileNameWithoutConfigFile(
115497
- fileNameForModuleFormatDetection,
115498
- options,
115499
- !host.useCaseSensitiveFileNames(),
115500
- currentDirectory,
115501
- getAssumedCommonSourceDirectory
115502
- ) || getOutputJSFileNameWithoutConfigFile(
115503
- fileNameForModuleFormatDetection,
115504
- options,
115505
- !host.useCaseSensitiveFileNames(),
115506
- currentDirectory,
115507
- getAssumedCommonSourceDirectory
115508
- ) || fileNameForModuleFormatDetection;
115509
- }
115510
- }
115511
- return getImpliedNodeFormatForFileWorker(
115512
- fileNameForModuleFormatDetection,
115513
- moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(),
115514
- host,
115515
- options
115516
- );
115517
- }
115518
- function getCreateSourceFileOptions(fileName) {
115519
- const result = getImpliedNodeFormatForFile(fileName);
115520
- const languageVersion = getEmitScriptTarget(options);
115521
- const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options);
115431
+ function getCreateSourceFileOptions(fileName, moduleResolutionCache2, host2, options2) {
115432
+ const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
115433
+ const languageVersion = getEmitScriptTarget(options2);
115434
+ const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
115522
115435
  return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
115523
115436
  }
115524
115437
  function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
@@ -115590,7 +115503,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
115590
115503
  redirectedPath = toPath3(redirect);
115591
115504
  }
115592
115505
  }
115593
- const sourceFileOptions = getCreateSourceFileOptions(fileName);
115506
+ const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options);
115594
115507
  const file = host.getSourceFile(
115595
115508
  fileName,
115596
115509
  sourceFileOptions,
@@ -116213,9 +116126,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
116213
116126
  createDiagnosticForOptionName(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files, "outDir");
116214
116127
  }
116215
116128
  }
116216
- if (assumedCommonSourceDirectory && assumedCommonSourceDirectory !== getCommonSourceDirectory2()) {
116217
- programDiagnostics.add(createCompilerDiagnostic(Diagnostics.The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supply_the_rootDir_compiler_option_to_disambiguate));
116218
- }
116219
116129
  if (options.useDefineForClassFields && languageVersion === 0 /* ES3 */) {
116220
116130
  createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields");
116221
116131
  }