typescript 6.0.0-dev.20251119 → 6.0.0-dev.20251121

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.
Files changed (3) hide show
  1. package/lib/_tsc.js +11 -66
  2. package/lib/typescript.js +11 -66
  3. package/package.json +19 -19
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.20251119`;
21
+ var version = `${versionMajorMinor}.0-dev.20251121`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6239,6 +6239,8 @@ var Diagnostics = {
6239
6239
  Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0: diag(1544, 1 /* Error */, "Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0_1544", "Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to '{0}'."),
6240
6240
  using_declarations_are_not_allowed_in_ambient_contexts: diag(1545, 1 /* Error */, "using_declarations_are_not_allowed_in_ambient_contexts_1545", "'using' declarations are not allowed in ambient contexts."),
6241
6241
  await_using_declarations_are_not_allowed_in_ambient_contexts: diag(1546, 1 /* Error */, "await_using_declarations_are_not_allowed_in_ambient_contexts_1546", "'await using' declarations are not allowed in ambient contexts."),
6242
+ using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block: diag(1547, 1 /* Error */, "using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1547", "'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block."),
6243
+ await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block: diag(1548, 1 /* Error */, "await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1548", "'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block."),
6242
6244
  The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
6243
6245
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
6244
6246
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -42745,6 +42747,9 @@ function createBinder() {
42745
42747
  function bindChildren(node) {
42746
42748
  const saveInAssignmentPattern = inAssignmentPattern;
42747
42749
  inAssignmentPattern = false;
42750
+ if (isPotentiallyExecutableNode(node)) {
42751
+ node.flags &= ~1073741824 /* Unreachable */;
42752
+ }
42748
42753
  if (currentFlow === unreachableFlow) {
42749
42754
  if (canHaveFlowNode(node)) {
42750
42755
  node.flowNode = void 0;
@@ -89965,6 +89970,11 @@ function createTypeChecker(host) {
89965
89970
  declarationList,
89966
89971
  blockScopeFlags === 4 /* Using */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration : Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration
89967
89972
  );
89973
+ } else if (isVariableStatement(declarationList.parent) && isCaseOrDefaultClause(declarationList.parent.parent)) {
89974
+ return grammarErrorOnNode(
89975
+ declarationList,
89976
+ blockScopeFlags === 4 /* Using */ ? Diagnostics.using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block : Diagnostics.await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block
89977
+ );
89968
89978
  }
89969
89979
  if (declarationList.flags & 33554432 /* Ambient */) {
89970
89980
  return grammarErrorOnNode(
@@ -102803,8 +102813,6 @@ function transformESNext(context) {
102803
102813
  return visitForStatement(node);
102804
102814
  case 251 /* ForOfStatement */:
102805
102815
  return visitForOfStatement(node);
102806
- case 256 /* SwitchStatement */:
102807
- return visitSwitchStatement(node);
102808
102816
  default:
102809
102817
  return visitEachChild(node, visitor, context);
102810
102818
  }
@@ -102968,60 +102976,6 @@ function transformESNext(context) {
102968
102976
  }
102969
102977
  return visitEachChild(node, visitor, context);
102970
102978
  }
102971
- function visitCaseOrDefaultClause(node, envBinding) {
102972
- if (getUsingKindOfStatements(node.statements) !== 0 /* None */) {
102973
- if (isCaseClause(node)) {
102974
- return factory2.updateCaseClause(
102975
- node,
102976
- visitNode(node.expression, visitor, isExpression),
102977
- transformUsingDeclarations(
102978
- node.statements,
102979
- /*start*/
102980
- 0,
102981
- node.statements.length,
102982
- envBinding,
102983
- /*topLevelStatements*/
102984
- void 0
102985
- )
102986
- );
102987
- } else {
102988
- return factory2.updateDefaultClause(
102989
- node,
102990
- transformUsingDeclarations(
102991
- node.statements,
102992
- /*start*/
102993
- 0,
102994
- node.statements.length,
102995
- envBinding,
102996
- /*topLevelStatements*/
102997
- void 0
102998
- )
102999
- );
103000
- }
103001
- }
103002
- return visitEachChild(node, visitor, context);
103003
- }
103004
- function visitSwitchStatement(node) {
103005
- const usingKind = getUsingKindOfCaseOrDefaultClauses(node.caseBlock.clauses);
103006
- if (usingKind) {
103007
- const envBinding = createEnvBinding();
103008
- return createDownlevelUsingStatements(
103009
- [
103010
- factory2.updateSwitchStatement(
103011
- node,
103012
- visitNode(node.expression, visitor, isExpression),
103013
- factory2.updateCaseBlock(
103014
- node.caseBlock,
103015
- node.caseBlock.clauses.map((clause) => visitCaseOrDefaultClause(clause, envBinding))
103016
- )
103017
- )
103018
- ],
103019
- envBinding,
103020
- usingKind === 2 /* Async */
103021
- );
103022
- }
103023
- return visitEachChild(node, visitor, context);
103024
- }
103025
102979
  function transformUsingDeclarations(statementsIn, start, end, envBinding, topLevelStatements) {
103026
102980
  const statements = [];
103027
102981
  for (let i = start; i < end; i++) {
@@ -103387,15 +103341,6 @@ function getUsingKindOfStatements(statements) {
103387
103341
  }
103388
103342
  return result;
103389
103343
  }
103390
- function getUsingKindOfCaseOrDefaultClauses(clauses) {
103391
- let result = 0 /* None */;
103392
- for (const clause of clauses) {
103393
- const usingKind = getUsingKindOfStatements(clause.statements);
103394
- if (usingKind === 2 /* Async */) return 2 /* Async */;
103395
- if (usingKind > result) result = usingKind;
103396
- }
103397
- return result;
103398
- }
103399
103344
 
103400
103345
  // src/compiler/transformers/jsx.ts
103401
103346
  function transformJsx(context) {
package/lib/typescript.js CHANGED
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(typescript_exports);
2286
2286
 
2287
2287
  // src/compiler/corePublic.ts
2288
2288
  var versionMajorMinor = "6.0";
2289
- var version = `${versionMajorMinor}.0-dev.20251119`;
2289
+ var version = `${versionMajorMinor}.0-dev.20251121`;
2290
2290
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2291
2291
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2292
2292
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9640,6 +9640,8 @@ var Diagnostics = {
9640
9640
  Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0: diag(1544, 1 /* Error */, "Named_imports_from_a_JSON_file_into_an_ECMAScript_module_are_not_allowed_when_module_is_set_to_0_1544", "Named imports from a JSON file into an ECMAScript module are not allowed when 'module' is set to '{0}'."),
9641
9641
  using_declarations_are_not_allowed_in_ambient_contexts: diag(1545, 1 /* Error */, "using_declarations_are_not_allowed_in_ambient_contexts_1545", "'using' declarations are not allowed in ambient contexts."),
9642
9642
  await_using_declarations_are_not_allowed_in_ambient_contexts: diag(1546, 1 /* Error */, "await_using_declarations_are_not_allowed_in_ambient_contexts_1546", "'await using' declarations are not allowed in ambient contexts."),
9643
+ using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block: diag(1547, 1 /* Error */, "using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1547", "'using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block."),
9644
+ await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block: diag(1548, 1 /* Error */, "await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1548", "'await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block."),
9643
9645
  The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
9644
9646
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
9645
9647
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -47273,6 +47275,9 @@ function createBinder() {
47273
47275
  function bindChildren(node) {
47274
47276
  const saveInAssignmentPattern = inAssignmentPattern;
47275
47277
  inAssignmentPattern = false;
47278
+ if (isPotentiallyExecutableNode(node)) {
47279
+ node.flags &= ~1073741824 /* Unreachable */;
47280
+ }
47276
47281
  if (currentFlow === unreachableFlow) {
47277
47282
  if (canHaveFlowNode(node)) {
47278
47283
  node.flowNode = void 0;
@@ -94593,6 +94598,11 @@ function createTypeChecker(host) {
94593
94598
  declarationList,
94594
94599
  blockScopeFlags === 4 /* Using */ ? Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration : Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration
94595
94600
  );
94601
+ } else if (isVariableStatement(declarationList.parent) && isCaseOrDefaultClause(declarationList.parent.parent)) {
94602
+ return grammarErrorOnNode(
94603
+ declarationList,
94604
+ blockScopeFlags === 4 /* Using */ ? Diagnostics.using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block : Diagnostics.await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block
94605
+ );
94596
94606
  }
94597
94607
  if (declarationList.flags & 33554432 /* Ambient */) {
94598
94608
  return grammarErrorOnNode(
@@ -107613,8 +107623,6 @@ function transformESNext(context) {
107613
107623
  return visitForStatement(node);
107614
107624
  case 251 /* ForOfStatement */:
107615
107625
  return visitForOfStatement(node);
107616
- case 256 /* SwitchStatement */:
107617
- return visitSwitchStatement(node);
107618
107626
  default:
107619
107627
  return visitEachChild(node, visitor, context);
107620
107628
  }
@@ -107778,60 +107786,6 @@ function transformESNext(context) {
107778
107786
  }
107779
107787
  return visitEachChild(node, visitor, context);
107780
107788
  }
107781
- function visitCaseOrDefaultClause(node, envBinding) {
107782
- if (getUsingKindOfStatements(node.statements) !== 0 /* None */) {
107783
- if (isCaseClause(node)) {
107784
- return factory2.updateCaseClause(
107785
- node,
107786
- visitNode(node.expression, visitor, isExpression),
107787
- transformUsingDeclarations(
107788
- node.statements,
107789
- /*start*/
107790
- 0,
107791
- node.statements.length,
107792
- envBinding,
107793
- /*topLevelStatements*/
107794
- void 0
107795
- )
107796
- );
107797
- } else {
107798
- return factory2.updateDefaultClause(
107799
- node,
107800
- transformUsingDeclarations(
107801
- node.statements,
107802
- /*start*/
107803
- 0,
107804
- node.statements.length,
107805
- envBinding,
107806
- /*topLevelStatements*/
107807
- void 0
107808
- )
107809
- );
107810
- }
107811
- }
107812
- return visitEachChild(node, visitor, context);
107813
- }
107814
- function visitSwitchStatement(node) {
107815
- const usingKind = getUsingKindOfCaseOrDefaultClauses(node.caseBlock.clauses);
107816
- if (usingKind) {
107817
- const envBinding = createEnvBinding();
107818
- return createDownlevelUsingStatements(
107819
- [
107820
- factory2.updateSwitchStatement(
107821
- node,
107822
- visitNode(node.expression, visitor, isExpression),
107823
- factory2.updateCaseBlock(
107824
- node.caseBlock,
107825
- node.caseBlock.clauses.map((clause) => visitCaseOrDefaultClause(clause, envBinding))
107826
- )
107827
- )
107828
- ],
107829
- envBinding,
107830
- usingKind === 2 /* Async */
107831
- );
107832
- }
107833
- return visitEachChild(node, visitor, context);
107834
- }
107835
107789
  function transformUsingDeclarations(statementsIn, start, end, envBinding, topLevelStatements) {
107836
107790
  const statements = [];
107837
107791
  for (let i = start; i < end; i++) {
@@ -108197,15 +108151,6 @@ function getUsingKindOfStatements(statements) {
108197
108151
  }
108198
108152
  return result;
108199
108153
  }
108200
- function getUsingKindOfCaseOrDefaultClauses(clauses) {
108201
- let result = 0 /* None */;
108202
- for (const clause of clauses) {
108203
- const usingKind = getUsingKindOfStatements(clause.statements);
108204
- if (usingKind === 2 /* Async */) return 2 /* Async */;
108205
- if (usingKind > result) result = usingKind;
108206
- }
108207
- return result;
108208
- }
108209
108154
 
108210
108155
  // src/compiler/transformers/jsx.ts
108211
108156
  function transformJsx(context) {
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.20251119",
5
+ "version": "6.0.0-dev.20251121",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -42,45 +42,45 @@
42
42
  "@dprint/formatter": "^0.4.1",
43
43
  "@dprint/typescript": "0.93.4",
44
44
  "@esfx/canceltoken": "^1.0.0",
45
- "@eslint/js": "^9.33.0",
46
- "@octokit/rest": "^21.1.1",
45
+ "@eslint/js": "^9.39.1",
46
+ "@octokit/rest": "^22.0.1",
47
47
  "@types/chai": "^4.3.20",
48
48
  "@types/minimist": "^1.2.5",
49
49
  "@types/mocha": "^10.0.10",
50
- "@types/ms": "^0.7.34",
50
+ "@types/ms": "^2.1.0",
51
51
  "@types/node": "latest",
52
52
  "@types/source-map-support": "^0.5.10",
53
53
  "@types/which": "^3.0.4",
54
- "@typescript-eslint/rule-tester": "^8.39.1",
55
- "@typescript-eslint/type-utils": "^8.39.1",
56
- "@typescript-eslint/utils": "^8.39.1",
54
+ "@typescript-eslint/rule-tester": "^8.47.0",
55
+ "@typescript-eslint/type-utils": "^8.47.0",
56
+ "@typescript-eslint/utils": "^8.47.0",
57
57
  "azure-devops-node-api": "^15.1.1",
58
58
  "c8": "^10.1.3",
59
59
  "chai": "^4.5.0",
60
60
  "chokidar": "^4.0.3",
61
61
  "diff": "^8.0.2",
62
62
  "dprint": "^0.49.1",
63
- "esbuild": "^0.25.9",
64
- "eslint": "^9.33.0",
63
+ "esbuild": "^0.27.0",
64
+ "eslint": "^9.39.1",
65
65
  "eslint-formatter-autolinkable-stylish": "^1.4.0",
66
66
  "eslint-plugin-regexp": "^2.10.0",
67
- "fast-xml-parser": "^5.2.5",
68
- "glob": "^10.4.5",
69
- "globals": "^16.3.0",
70
- "hereby": "^1.11.0",
67
+ "fast-xml-parser": "^5.3.2",
68
+ "glob": "^10.5.0",
69
+ "globals": "^16.5.0",
70
+ "hereby": "^1.11.1",
71
71
  "jsonc-parser": "^3.3.1",
72
- "knip": "^5.62.0",
72
+ "knip": "^5.70.0",
73
73
  "minimist": "^1.2.8",
74
74
  "mocha": "^10.8.2",
75
75
  "mocha-fivemat-progress-reporter": "^0.1.0",
76
- "monocart-coverage-reports": "^2.12.6",
76
+ "monocart-coverage-reports": "^2.12.9",
77
77
  "ms": "^2.1.3",
78
78
  "picocolors": "^1.1.1",
79
- "playwright": "^1.54.2",
79
+ "playwright": "^1.56.1",
80
80
  "source-map-support": "^0.5.21",
81
81
  "tslib": "^2.8.1",
82
- "typescript": "^5.9.2",
83
- "typescript-eslint": "^8.39.1",
82
+ "typescript": "^5.9.3",
83
+ "typescript-eslint": "^8.47.0",
84
84
  "which": "^3.0.1"
85
85
  },
86
86
  "overrides": {
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "cc2610fd347127c28609b4fca6fa9d55ee5063c6"
118
+ "gitHead": "60e99ecee46767e9f37e6f60dd48b71cd45c099a"
119
119
  }