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/typescript.js CHANGED
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
2285
2285
 
2286
2286
  // src/compiler/corePublic.ts
2287
2287
  var versionMajorMinor = "5.8";
2288
- var version = `${versionMajorMinor}.0-dev.20250121`;
2288
+ var version = `${versionMajorMinor}.0-dev.20250123`;
2289
2289
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2290
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2291
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10210,6 +10210,7 @@ var Diagnostics = {
10210
10210
  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."),
10211
10211
  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."),
10212
10212
  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."),
10213
+ 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'."),
10213
10214
  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}'."),
10214
10215
  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}'."),
10215
10216
  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}'."),
@@ -16865,6 +16866,9 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
16865
16866
  "trunc",
16866
16867
  "fround",
16867
16868
  "cbrt"
16869
+ ],
16870
+ esnext: [
16871
+ "f16round"
16868
16872
  ]
16869
16873
  })),
16870
16874
  Map: new Map(Object.entries({
@@ -17034,6 +17038,10 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
17034
17038
  "setBigUint64",
17035
17039
  "getBigInt64",
17036
17040
  "getBigUint64"
17041
+ ],
17042
+ esnext: [
17043
+ "setFloat16",
17044
+ "getFloat16"
17037
17045
  ]
17038
17046
  })),
17039
17047
  BigInt: new Map(Object.entries({
@@ -17137,6 +17145,9 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
17137
17145
  "with"
17138
17146
  ]
17139
17147
  })),
17148
+ Float16Array: new Map(Object.entries({
17149
+ esnext: emptyArray
17150
+ })),
17140
17151
  Float32Array: new Map(Object.entries({
17141
17152
  es2022: [
17142
17153
  "at"
@@ -40516,6 +40527,7 @@ var libEntries = [
40516
40527
  ["esnext.string", "lib.es2024.string.d.ts"],
40517
40528
  ["esnext.iterator", "lib.esnext.iterator.d.ts"],
40518
40529
  ["esnext.promise", "lib.esnext.promise.d.ts"],
40530
+ ["esnext.float16", "lib.esnext.float16.d.ts"],
40519
40531
  ["decorators", "lib.decorators.d.ts"],
40520
40532
  ["decorators.legacy", "lib.decorators.legacy.d.ts"]
40521
40533
  ];
@@ -46037,7 +46049,7 @@ function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directo
46037
46049
  );
46038
46050
  }
46039
46051
  function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
46040
- const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
46052
+ const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ || state.conditions.includes("import") ? 99 /* ESNext */ : 1 /* CommonJS */;
46041
46053
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
46042
46054
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
46043
46055
  if (priorityExtensions) {
@@ -47376,13 +47388,16 @@ function createBinder() {
47376
47388
  function bindForStatement(node) {
47377
47389
  const preLoopLabel = setContinueTarget(node, createLoopLabel());
47378
47390
  const preBodyLabel = createBranchLabel();
47391
+ const preIncrementorLabel = createBranchLabel();
47379
47392
  const postLoopLabel = createBranchLabel();
47380
47393
  bind(node.initializer);
47381
47394
  addAntecedent(preLoopLabel, currentFlow);
47382
47395
  currentFlow = preLoopLabel;
47383
47396
  bindCondition(node.condition, preBodyLabel, postLoopLabel);
47384
47397
  currentFlow = finishFlowLabel(preBodyLabel);
47385
- bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
47398
+ bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
47399
+ addAntecedent(preIncrementorLabel, currentFlow);
47400
+ currentFlow = finishFlowLabel(preIncrementorLabel);
47386
47401
  bind(node.incrementor);
47387
47402
  addAntecedent(preLoopLabel, currentFlow);
47388
47403
  currentFlow = finishFlowLabel(postLoopLabel);
@@ -53785,7 +53800,7 @@ function createTypeChecker(host) {
53785
53800
  moduleReference
53786
53801
  );
53787
53802
  }
53788
- if (errorNode && (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */)) {
53803
+ if (errorNode && (moduleKind === 100 /* Node16 */ || moduleKind === 101 /* Node18 */)) {
53789
53804
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
53790
53805
  const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l) || isJSDocImportTag(l));
53791
53806
  if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
@@ -64184,6 +64199,9 @@ function createTypeChecker(host) {
64184
64199
  case "Number":
64185
64200
  checkNoTypeArguments(node);
64186
64201
  return numberType;
64202
+ case "BigInt":
64203
+ checkNoTypeArguments(node);
64204
+ return bigintType;
64187
64205
  case "Boolean":
64188
64206
  checkNoTypeArguments(node);
64189
64207
  return booleanType;
@@ -73103,6 +73121,7 @@ function createTypeChecker(host) {
73103
73121
  return target.kind === 108 /* SuperKeyword */;
73104
73122
  case 235 /* NonNullExpression */:
73105
73123
  case 217 /* ParenthesizedExpression */:
73124
+ case 238 /* SatisfiesExpression */:
73106
73125
  return isMatchingReference(source.expression, target);
73107
73126
  case 211 /* PropertyAccessExpression */:
73108
73127
  case 212 /* ElementAccessExpression */:
@@ -75072,6 +75091,7 @@ function createTypeChecker(host) {
75072
75091
  return narrowTypeByCallExpression(type, expr, assumeTrue);
75073
75092
  case 217 /* ParenthesizedExpression */:
75074
75093
  case 235 /* NonNullExpression */:
75094
+ case 238 /* SatisfiesExpression */:
75075
75095
  return narrowType(type, expr.expression, assumeTrue);
75076
75096
  case 226 /* BinaryExpression */:
75077
75097
  return narrowTypeByBinaryExpression(type, expr, assumeTrue);
@@ -89888,6 +89908,9 @@ function createTypeChecker(host) {
89888
89908
  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
89889
89909
  );
89890
89910
  }
89911
+ if (moduleKind === 199 /* NodeNext */ && !isImportAttributes2) {
89912
+ return grammarErrorOnFirstToken(node, Diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_asserts);
89913
+ }
89891
89914
  if (declaration.moduleSpecifier && getEmitSyntaxForModuleSpecifierExpression(declaration.moduleSpecifier) === 1 /* CommonJS */) {
89892
89915
  return grammarErrorOnNode(
89893
89916
  node,
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": "5.8.0-dev.20250121",
5
+ "version": "5.8.0-dev.20250123",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -116,5 +116,5 @@
116
116
  "node": "20.1.0",
117
117
  "npm": "8.19.4"
118
118
  },
119
- "gitHead": "8da951cbb629b648753454872df4e1754982aef1"
119
+ "gitHead": "5e52b28ee6d54f6637990be6d0dda1e974f78345"
120
120
  }