@typescript-deploys/pr-build 5.9.0-pr-62111-2 → 6.0.0-pr-62243-2

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
@@ -2284,8 +2284,8 @@ __export(typescript_exports, {
2284
2284
  module.exports = __toCommonJS(typescript_exports);
2285
2285
 
2286
2286
  // src/compiler/corePublic.ts
2287
- var versionMajorMinor = "5.9";
2288
- var version = `${versionMajorMinor}.0-insiders.20250723`;
2287
+ var versionMajorMinor = "6.0";
2288
+ var version = `${versionMajorMinor}.0-insiders.20250809`;
2289
2289
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2290
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2291
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9400,15 +9400,16 @@ var Diagnostics = {
9400
9400
  An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1283, 1 /* Error */, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),
9401
9401
  An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1284, 1 /* Error */, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),
9402
9402
  An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1285, 1 /* Error */, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),
9403
- ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
9403
+ ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax: diag(1286, 1 /* Error */, "ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286", "ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'."),
9404
9404
  A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
9405
9405
  An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),
9406
9406
  _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
9407
9407
  _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
9408
9408
  _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
9409
9409
  _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
9410
- ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
9410
+ ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
9411
9411
  This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled: diag(1294, 1 /* Error */, "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294", "This syntax is not allowed when 'erasableSyntaxOnly' is enabled."),
9412
+ ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript: diag(1295, 1 /* Error */, "ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295", "ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript."),
9412
9413
  with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
9413
9414
  await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
9414
9415
  The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
@@ -17951,12 +17952,15 @@ function forEachYieldExpression(body, visitor) {
17951
17952
  function traverse(node) {
17952
17953
  switch (node.kind) {
17953
17954
  case 230 /* YieldExpression */:
17954
- visitor(node);
17955
+ const value = visitor(node);
17956
+ if (value) {
17957
+ return value;
17958
+ }
17955
17959
  const operand = node.expression;
17956
- if (operand) {
17957
- traverse(operand);
17960
+ if (!operand) {
17961
+ return;
17958
17962
  }
17959
- return;
17963
+ return traverse(operand);
17960
17964
  case 267 /* EnumDeclaration */:
17961
17965
  case 265 /* InterfaceDeclaration */:
17962
17966
  case 268 /* ModuleDeclaration */:
@@ -17965,11 +17969,10 @@ function forEachYieldExpression(body, visitor) {
17965
17969
  default:
17966
17970
  if (isFunctionLike(node)) {
17967
17971
  if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
17968
- traverse(node.name.expression);
17969
- return;
17972
+ return traverse(node.name.expression);
17970
17973
  }
17971
17974
  } else if (!isPartOfTypeNode(node)) {
17972
- forEachChild(node, traverse);
17975
+ return forEachChild(node, traverse);
17973
17976
  }
17974
17977
  }
17975
17978
  }
@@ -23120,7 +23123,7 @@ function hasContextSensitiveParameters(node) {
23120
23123
  if (node.kind !== 220 /* ArrowFunction */) {
23121
23124
  const parameter = firstOrUndefined(node.parameters);
23122
23125
  if (!(parameter && parameterIsThisKeyword(parameter))) {
23123
- return true;
23126
+ return !!(node.flags & 256 /* ContainsThis */);
23124
23127
  }
23125
23128
  }
23126
23129
  }
@@ -47154,6 +47157,7 @@ function createBinder() {
47154
47157
  const saveExceptionTarget = currentExceptionTarget;
47155
47158
  const saveActiveLabelList = activeLabelList;
47156
47159
  const saveHasExplicitReturn = hasExplicitReturn;
47160
+ const saveSeenThisKeyword = seenThisKeyword;
47157
47161
  const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
47158
47162
  if (!isImmediatelyInvoked) {
47159
47163
  currentFlow = createFlowNode(
@@ -47173,13 +47177,17 @@ function createBinder() {
47173
47177
  currentContinueTarget = void 0;
47174
47178
  activeLabelList = void 0;
47175
47179
  hasExplicitReturn = false;
47180
+ seenThisKeyword = false;
47176
47181
  bindChildren(node);
47177
- node.flags &= ~5632 /* ReachabilityAndEmitFlags */;
47182
+ node.flags &= ~(5632 /* ReachabilityAndEmitFlags */ | 256 /* ContainsThis */);
47178
47183
  if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
47179
47184
  node.flags |= 512 /* HasImplicitReturn */;
47180
47185
  if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
47181
47186
  node.endFlowNode = currentFlow;
47182
47187
  }
47188
+ if (seenThisKeyword) {
47189
+ node.flags |= 256 /* ContainsThis */;
47190
+ }
47183
47191
  if (node.kind === 308 /* SourceFile */) {
47184
47192
  node.flags |= emitFlags;
47185
47193
  node.endFlowNode = currentFlow;
@@ -47200,11 +47208,14 @@ function createBinder() {
47200
47208
  currentExceptionTarget = saveExceptionTarget;
47201
47209
  activeLabelList = saveActiveLabelList;
47202
47210
  hasExplicitReturn = saveHasExplicitReturn;
47211
+ seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
47203
47212
  } else if (containerFlags & 64 /* IsInterface */) {
47213
+ const saveSeenThisKeyword = seenThisKeyword;
47204
47214
  seenThisKeyword = false;
47205
47215
  bindChildren(node);
47206
47216
  Debug.assertNotNode(node, isIdentifier);
47207
47217
  node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
47218
+ seenThisKeyword = saveSeenThisKeyword;
47208
47219
  } else {
47209
47220
  bindChildren(node);
47210
47221
  }
@@ -48692,6 +48703,9 @@ function createBinder() {
48692
48703
  }
48693
48704
  // falls through
48694
48705
  case 110 /* ThisKeyword */:
48706
+ if (node.kind === 110 /* ThisKeyword */) {
48707
+ seenThisKeyword = true;
48708
+ }
48695
48709
  if (currentFlow && (isExpression(node) || parent2.kind === 305 /* ShorthandPropertyAssignment */)) {
48696
48710
  node.flowNode = currentFlow;
48697
48711
  }
@@ -49614,6 +49628,8 @@ function getContainerFlags(node) {
49614
49628
  // falls through
49615
49629
  case 177 /* Constructor */:
49616
49630
  case 263 /* FunctionDeclaration */:
49631
+ case 176 /* ClassStaticBlockDeclaration */:
49632
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49617
49633
  case 174 /* MethodSignature */:
49618
49634
  case 180 /* CallSignature */:
49619
49635
  case 324 /* JSDocSignature */:
@@ -49621,17 +49637,14 @@ function getContainerFlags(node) {
49621
49637
  case 185 /* FunctionType */:
49622
49638
  case 181 /* ConstructSignature */:
49623
49639
  case 186 /* ConstructorType */:
49624
- case 176 /* ClassStaticBlockDeclaration */:
49625
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49640
+ return 1 /* IsContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49626
49641
  case 352 /* JSDocImportTag */:
49627
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
49642
+ return 1 /* IsContainer */ | 32 /* HasLocals */;
49628
49643
  case 219 /* FunctionExpression */:
49629
49644
  case 220 /* ArrowFunction */:
49630
49645
  return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
49631
49646
  case 269 /* ModuleBlock */:
49632
49647
  return 4 /* IsControlFlowContainer */;
49633
- case 173 /* PropertyDeclaration */:
49634
- return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
49635
49648
  case 300 /* CatchClause */:
49636
49649
  case 249 /* ForStatement */:
49637
49650
  case 250 /* ForInStatement */:
@@ -52126,6 +52139,15 @@ function createTypeChecker(host) {
52126
52139
  diagnostics.add(diagnostic);
52127
52140
  return diagnostic;
52128
52141
  }
52142
+ function getVerbatimModuleSyntaxErrorMessage(node) {
52143
+ const sourceFile = getSourceFileOfNode(node);
52144
+ const fileName = sourceFile.fileName;
52145
+ if (fileExtensionIsOneOf(fileName, [".cts" /* Cts */, ".cjs" /* Cjs */])) {
52146
+ return Diagnostics.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax;
52147
+ } else {
52148
+ return Diagnostics.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript;
52149
+ }
52150
+ }
52129
52151
  function addErrorOrSuggestion(isError, diagnostic) {
52130
52152
  if (isError) {
52131
52153
  diagnostics.add(diagnostic);
@@ -56669,6 +56691,9 @@ function createTypeChecker(host) {
56669
56691
  if (getDeclarationModifierFlagsFromSymbol(propertySymbol) & (2 /* Private */ | 4 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) {
56670
56692
  context.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(propertySymbol.escapedName));
56671
56693
  }
56694
+ if (isPrivateIdentifierSymbol(propertySymbol) && context.tracker.reportPrivateInBaseOfClassExpression) {
56695
+ context.tracker.reportPrivateInBaseOfClassExpression(idText(propertySymbol.valueDeclaration.name));
56696
+ }
56672
56697
  }
56673
56698
  if (checkTruncationLength(context) && i + 2 < properties.length - 1) {
56674
56699
  context.out.truncated = true;
@@ -68333,7 +68358,8 @@ function createTypeChecker(host) {
68333
68358
  const { initializer } = node;
68334
68359
  return !!initializer && isContextSensitive(initializer);
68335
68360
  }
68336
- case 295 /* JsxExpression */: {
68361
+ case 295 /* JsxExpression */:
68362
+ case 230 /* YieldExpression */: {
68337
68363
  const { expression } = node;
68338
68364
  return !!expression && isContextSensitive(expression);
68339
68365
  }
@@ -68341,7 +68367,7 @@ function createTypeChecker(host) {
68341
68367
  return false;
68342
68368
  }
68343
68369
  function isContextSensitiveFunctionLikeDeclaration(node) {
68344
- return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
68370
+ return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node) || !!(getFunctionFlags(node) & 1 /* Generator */ && node.body && forEachYieldExpression(node.body, isContextSensitive));
68345
68371
  }
68346
68372
  function hasContextSensitiveReturnExpression(node) {
68347
68373
  if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
@@ -90494,9 +90520,9 @@ function createTypeChecker(host) {
90494
90520
  }
90495
90521
  }
90496
90522
  if (compilerOptions.verbatimModuleSyntax && node.kind !== 272 /* ImportEqualsDeclaration */ && !isInJSFile(node) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) {
90497
- error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
90523
+ error2(node, getVerbatimModuleSyntaxErrorMessage(node));
90498
90524
  } else if (moduleKind === 200 /* Preserve */ && node.kind !== 272 /* ImportEqualsDeclaration */ && node.kind !== 261 /* VariableDeclaration */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) {
90499
- error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve);
90525
+ error2(node, Diagnostics.ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve);
90500
90526
  }
90501
90527
  if (compilerOptions.verbatimModuleSyntax && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */) && targetFlags & 128 /* ConstEnum */) {
90502
90528
  const constEnumDeclaration = target.valueDeclaration;
@@ -90855,7 +90881,7 @@ function createTypeChecker(host) {
90855
90881
  checkExpressionCached(node.expression);
90856
90882
  }
90857
90883
  if (isIllegalExportDefaultInCJS) {
90858
- error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
90884
+ error2(node, getVerbatimModuleSyntaxErrorMessage(node));
90859
90885
  }
90860
90886
  checkExternalModuleExports(container);
90861
90887
  if (node.flags & 33554432 /* Ambient */ && !isEntityNameExpression(node.expression)) {
@@ -94723,7 +94749,7 @@ function createTypeChecker(host) {
94723
94749
  }
94724
94750
  function checkGrammarImportCallExpression(node) {
94725
94751
  if (compilerOptions.verbatimModuleSyntax && moduleKind === 1 /* CommonJS */) {
94726
- return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
94752
+ return grammarErrorOnNode(node, getVerbatimModuleSyntaxErrorMessage(node));
94727
94753
  }
94728
94754
  if (node.expression.kind === 237 /* MetaProperty */) {
94729
94755
  if (moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) {
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": "5.9.0-pr-62111-2",
5
+ "version": "6.0.0-pr-62243-2",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [