typescript 5.8.0-dev.20250121 → 5.8.0-dev.20250123

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.8";
21
- var version = `${versionMajorMinor}.0-dev.20250121`;
21
+ var version = `${versionMajorMinor}.0-dev.20250123`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6824,6 +6824,7 @@ var Diagnostics = {
6824
6824
  This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_during_emit_because_it_is_not_a_relative_path: diag(2877, 1 /* Error */, "This_import_uses_a_0_extension_to_resolve_to_an_input_TypeScript_file_but_will_not_be_rewritten_duri_2877", "This import uses a '{0}' extension to resolve to an input TypeScript file, but will not be rewritten during emit because it is not a relative path."),
6825
6825
  This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
6826
6826
  Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
6827
+ Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'asserts'."),
6827
6828
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
6828
6829
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
6829
6830
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -13236,6 +13237,9 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
13236
13237
  "trunc",
13237
13238
  "fround",
13238
13239
  "cbrt"
13240
+ ],
13241
+ esnext: [
13242
+ "f16round"
13239
13243
  ]
13240
13244
  })),
13241
13245
  Map: new Map(Object.entries({
@@ -13405,6 +13409,10 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
13405
13409
  "setBigUint64",
13406
13410
  "getBigInt64",
13407
13411
  "getBigUint64"
13412
+ ],
13413
+ esnext: [
13414
+ "setFloat16",
13415
+ "getFloat16"
13408
13416
  ]
13409
13417
  })),
13410
13418
  BigInt: new Map(Object.entries({
@@ -13508,6 +13516,9 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
13508
13516
  "with"
13509
13517
  ]
13510
13518
  })),
13519
+ Float16Array: new Map(Object.entries({
13520
+ esnext: emptyArray
13521
+ })),
13511
13522
  Float32Array: new Map(Object.entries({
13512
13523
  es2022: [
13513
13524
  "at"
@@ -36256,6 +36267,7 @@ var libEntries = [
36256
36267
  ["esnext.string", "lib.es2024.string.d.ts"],
36257
36268
  ["esnext.iterator", "lib.esnext.iterator.d.ts"],
36258
36269
  ["esnext.promise", "lib.esnext.promise.d.ts"],
36270
+ ["esnext.float16", "lib.esnext.float16.d.ts"],
36259
36271
  ["decorators", "lib.decorators.d.ts"],
36260
36272
  ["decorators.legacy", "lib.decorators.legacy.d.ts"]
36261
36273
  ];
@@ -41545,7 +41557,7 @@ function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directo
41545
41557
  );
41546
41558
  }
41547
41559
  function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
41548
- const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
41560
+ const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ || state.conditions.includes("import") ? 99 /* ESNext */ : 1 /* CommonJS */;
41549
41561
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
41550
41562
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
41551
41563
  if (priorityExtensions) {
@@ -42866,13 +42878,16 @@ function createBinder() {
42866
42878
  function bindForStatement(node) {
42867
42879
  const preLoopLabel = setContinueTarget(node, createLoopLabel());
42868
42880
  const preBodyLabel = createBranchLabel();
42881
+ const preIncrementorLabel = createBranchLabel();
42869
42882
  const postLoopLabel = createBranchLabel();
42870
42883
  bind(node.initializer);
42871
42884
  addAntecedent(preLoopLabel, currentFlow);
42872
42885
  currentFlow = preLoopLabel;
42873
42886
  bindCondition(node.condition, preBodyLabel, postLoopLabel);
42874
42887
  currentFlow = finishFlowLabel(preBodyLabel);
42875
- bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
42888
+ bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
42889
+ addAntecedent(preIncrementorLabel, currentFlow);
42890
+ currentFlow = finishFlowLabel(preIncrementorLabel);
42876
42891
  bind(node.incrementor);
42877
42892
  addAntecedent(preLoopLabel, currentFlow);
42878
42893
  currentFlow = finishFlowLabel(postLoopLabel);
@@ -49175,7 +49190,7 @@ function createTypeChecker(host) {
49175
49190
  moduleReference
49176
49191
  );
49177
49192
  }
49178
- if (errorNode && (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */)) {
49193
+ if (errorNode && (moduleKind === 100 /* Node16 */ || moduleKind === 101 /* Node18 */)) {
49179
49194
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
49180
49195
  const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l) || isJSDocImportTag(l));
49181
49196
  if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
@@ -59574,6 +59589,9 @@ function createTypeChecker(host) {
59574
59589
  case "Number":
59575
59590
  checkNoTypeArguments(node);
59576
59591
  return numberType;
59592
+ case "BigInt":
59593
+ checkNoTypeArguments(node);
59594
+ return bigintType;
59577
59595
  case "Boolean":
59578
59596
  checkNoTypeArguments(node);
59579
59597
  return booleanType;
@@ -68493,6 +68511,7 @@ function createTypeChecker(host) {
68493
68511
  return target.kind === 108 /* SuperKeyword */;
68494
68512
  case 235 /* NonNullExpression */:
68495
68513
  case 217 /* ParenthesizedExpression */:
68514
+ case 238 /* SatisfiesExpression */:
68496
68515
  return isMatchingReference(source.expression, target);
68497
68516
  case 211 /* PropertyAccessExpression */:
68498
68517
  case 212 /* ElementAccessExpression */:
@@ -70462,6 +70481,7 @@ function createTypeChecker(host) {
70462
70481
  return narrowTypeByCallExpression(type, expr, assumeTrue);
70463
70482
  case 217 /* ParenthesizedExpression */:
70464
70483
  case 235 /* NonNullExpression */:
70484
+ case 238 /* SatisfiesExpression */:
70465
70485
  return narrowType(type, expr.expression, assumeTrue);
70466
70486
  case 226 /* BinaryExpression */:
70467
70487
  return narrowTypeByBinaryExpression(type, expr, assumeTrue);
@@ -85278,6 +85298,9 @@ function createTypeChecker(host) {
85278
85298
  isImportAttributes2 ? Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve
85279
85299
  );
85280
85300
  }
85301
+ if (moduleKind === 199 /* NodeNext */ && !isImportAttributes2) {
85302
+ return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts);
85303
+ }
85281
85304
  if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1 /* CommonJS */) {
85282
85305
  return grammarErrorOnNode(
85283
85306
  node,