typescript 5.3.0-dev.20230921 → 5.3.0-dev.20230923

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.
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.3";
57
- var version = `${versionMajorMinor}.0-dev.20230921`;
57
+ var version = `${versionMajorMinor}.0-dev.20230923`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -6019,6 +6019,7 @@ var Diagnostics = {
6019
6019
  await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
6020
6020
  await_using_statements_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(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements 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."),
6021
6021
  Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
6022
+ Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1 /* Error */, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
6022
6023
  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}'."),
6023
6024
  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}'."),
6024
6025
  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}'."),
@@ -7066,7 +7067,7 @@ var Diagnostics = {
7066
7067
  Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"),
7067
7068
  Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"),
7068
7069
  Could_not_convert_to_anonymous_function: diag(95153, 3 /* Message */, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"),
7069
- Can_only_convert_string_concatenation: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenation_95154", "Can only convert string concatenation"),
7070
+ Can_only_convert_string_concatenations_and_string_literals: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenations_and_string_literals_95154", "Can only convert string concatenations and string literals"),
7070
7071
  Selection_is_not_a_valid_statement_or_statements: diag(95155, 3 /* Message */, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"),
7071
7072
  Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"),
7072
7073
  Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
@@ -7310,7 +7311,7 @@ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 18
7310
7311
  var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999];
7311
7312
  var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
7312
7313
  var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
7313
- var semanticJSDocTagRegEx = /@(?:see|link)/i;
7314
+ var jsDocSeeOrLink = /@(?:see|link)/i;
7314
7315
  function lookupInUnicodeMap(code, map2) {
7315
7316
  if (code < map2[0]) {
7316
7317
  return false;
@@ -7739,7 +7740,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
7739
7740
  var tokenFlags;
7740
7741
  var commentDirectives;
7741
7742
  var inJSDocType = 0;
7742
- var skipNonSemanticJSDoc = false;
7743
+ var scriptKind = 0 /* Unknown */;
7744
+ var jsDocParsingMode = 0 /* ParseAll */;
7743
7745
  setText(text, start, length2);
7744
7746
  var scanner = {
7745
7747
  getTokenFullStart: () => fullStartPos,
@@ -7783,14 +7785,15 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
7783
7785
  setText,
7784
7786
  setScriptTarget,
7785
7787
  setLanguageVariant,
7788
+ setScriptKind,
7789
+ setJSDocParsingMode,
7786
7790
  setOnError,
7787
7791
  resetTokenState,
7788
7792
  setTextPos: resetTokenState,
7789
7793
  setInJSDocType,
7790
7794
  tryScan,
7791
7795
  lookAhead,
7792
- scanRange,
7793
- setSkipNonSemanticJSDoc
7796
+ scanRange
7794
7797
  };
7795
7798
  if (Debug.isDebugging) {
7796
7799
  Object.defineProperty(scanner, "__debugShowCurrentPositionInText", {
@@ -8578,7 +8581,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8578
8581
  tokenFlags |= 1 /* PrecedingLineBreak */;
8579
8582
  }
8580
8583
  }
8581
- if (isJSDoc2 && (!skipNonSemanticJSDoc || semanticJSDocTagRegEx.test(text.slice(fullStartPos, pos)))) {
8584
+ if (isJSDoc2 && shouldParseJSDoc()) {
8582
8585
  tokenFlags |= 2 /* PrecedingJSDocComment */;
8583
8586
  }
8584
8587
  commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
@@ -8837,6 +8840,21 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8837
8840
  }
8838
8841
  }
8839
8842
  }
8843
+ function shouldParseJSDoc() {
8844
+ switch (jsDocParsingMode) {
8845
+ case 0 /* ParseAll */:
8846
+ return true;
8847
+ case 1 /* ParseNone */:
8848
+ return false;
8849
+ }
8850
+ if (scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */) {
8851
+ return true;
8852
+ }
8853
+ if (jsDocParsingMode === 3 /* ParseForTypeInfo */) {
8854
+ return false;
8855
+ }
8856
+ return jsDocSeeOrLink.test(text.slice(fullStartPos, pos));
8857
+ }
8840
8858
  function reScanInvalidIdentifier() {
8841
8859
  Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
8842
8860
  pos = tokenStart = fullStartPos;
@@ -9251,8 +9269,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9251
9269
  function setLanguageVariant(variant) {
9252
9270
  languageVariant = variant;
9253
9271
  }
9254
- function setSkipNonSemanticJSDoc(skip) {
9255
- skipNonSemanticJSDoc = skip;
9272
+ function setScriptKind(kind) {
9273
+ scriptKind = kind;
9274
+ }
9275
+ function setJSDocParsingMode(kind) {
9276
+ jsDocParsingMode = kind;
9256
9277
  }
9257
9278
  function resetTokenState(position) {
9258
9279
  Debug.assert(position >= 0);
@@ -18277,7 +18298,7 @@ var Parser;
18277
18298
  var contextFlags;
18278
18299
  var topLevel = true;
18279
18300
  var parseErrorBeforeNextFinishedNode = false;
18280
- function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, skipNonSemanticJSDoc) {
18301
+ function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) {
18281
18302
  var _a;
18282
18303
  scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
18283
18304
  if (scriptKind2 === 6 /* JSON */) {
@@ -18299,9 +18320,8 @@ var Parser;
18299
18320
  result2.pragmas = emptyMap;
18300
18321
  return result2;
18301
18322
  }
18302
- skipNonSemanticJSDoc = !!skipNonSemanticJSDoc && scriptKind2 !== 1 /* JS */ && scriptKind2 !== 2 /* JSX */;
18303
- initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, skipNonSemanticJSDoc);
18304
- const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
18323
+ initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
18324
+ const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
18305
18325
  clearState();
18306
18326
  return result;
18307
18327
  }
@@ -18314,8 +18334,7 @@ var Parser;
18314
18334
  /*syntaxCursor*/
18315
18335
  void 0,
18316
18336
  1 /* JS */,
18317
- /*skipNonSemanticJSDoc*/
18318
- false
18337
+ 0 /* ParseAll */
18319
18338
  );
18320
18339
  nextToken();
18321
18340
  const entityName = parseEntityName(
@@ -18328,15 +18347,7 @@ var Parser;
18328
18347
  }
18329
18348
  Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
18330
18349
  function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
18331
- initializeState(
18332
- fileName2,
18333
- sourceText2,
18334
- languageVersion2,
18335
- syntaxCursor2,
18336
- 6 /* JSON */,
18337
- /*skipNonSemanticJSDoc*/
18338
- false
18339
- );
18350
+ initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */);
18340
18351
  sourceFlags = contextFlags;
18341
18352
  nextToken();
18342
18353
  const pos = getNodePos();
@@ -18417,7 +18428,7 @@ var Parser;
18417
18428
  return result;
18418
18429
  }
18419
18430
  Parser2.parseJsonText = parseJsonText2;
18420
- function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _skipNonSemanticJSDoc) {
18431
+ function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
18421
18432
  NodeConstructor2 = objectAllocator.getNodeConstructor();
18422
18433
  TokenConstructor2 = objectAllocator.getTokenConstructor();
18423
18434
  IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
@@ -18453,13 +18464,15 @@ var Parser;
18453
18464
  scanner.setOnError(scanError);
18454
18465
  scanner.setScriptTarget(languageVersion);
18455
18466
  scanner.setLanguageVariant(languageVariant);
18456
- scanner.setSkipNonSemanticJSDoc(_skipNonSemanticJSDoc);
18467
+ scanner.setScriptKind(scriptKind);
18468
+ scanner.setJSDocParsingMode(_jsDocParsingMode);
18457
18469
  }
18458
18470
  function clearState() {
18459
18471
  scanner.clearCommentDirectives();
18460
18472
  scanner.setText("");
18461
18473
  scanner.setOnError(void 0);
18462
- scanner.setSkipNonSemanticJSDoc(false);
18474
+ scanner.setScriptKind(0 /* Unknown */);
18475
+ scanner.setJSDocParsingMode(0 /* ParseAll */);
18463
18476
  sourceText = void 0;
18464
18477
  languageVersion = void 0;
18465
18478
  syntaxCursor = void 0;
@@ -18473,7 +18486,7 @@ var Parser;
18473
18486
  notParenthesizedArrow = void 0;
18474
18487
  topLevel = true;
18475
18488
  }
18476
- function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, skipNonSemanticJSDoc) {
18489
+ function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
18477
18490
  const isDeclarationFile = isDeclarationFileName(fileName);
18478
18491
  if (isDeclarationFile) {
18479
18492
  contextFlags |= 33554432 /* Ambient */;
@@ -18492,7 +18505,7 @@ var Parser;
18492
18505
  sourceFile.identifierCount = identifierCount;
18493
18506
  sourceFile.identifiers = identifiers;
18494
18507
  sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
18495
- sourceFile.skipNonSemanticJSDoc = skipNonSemanticJSDoc;
18508
+ sourceFile.jsDocParsingMode = jsDocParsingMode;
18496
18509
  if (jsDocDiagnostics) {
18497
18510
  sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
18498
18511
  }
@@ -23927,8 +23940,7 @@ var Parser;
23927
23940
  /*syntaxCursor*/
23928
23941
  void 0,
23929
23942
  1 /* JS */,
23930
- /*skipNonSemanticJSDoc*/
23931
- false
23943
+ 0 /* ParseAll */
23932
23944
  );
23933
23945
  scanner.setText(content, start, length2);
23934
23946
  currentToken = scanner.scan();
@@ -23993,8 +24005,7 @@ var Parser;
23993
24005
  /*syntaxCursor*/
23994
24006
  void 0,
23995
24007
  1 /* JS */,
23996
- /*skipNonSemanticJSDoc*/
23997
- false
24008
+ 0 /* ParseAll */
23998
24009
  );
23999
24010
  const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2));
24000
24011
  const sourceFile = { languageVariant: 0 /* Standard */, text: content };
@@ -24951,7 +24962,7 @@ var IncrementalParser;
24951
24962
  true,
24952
24963
  sourceFile.scriptKind,
24953
24964
  sourceFile.setExternalModuleIndicator,
24954
- sourceFile.skipNonSemanticJSDoc
24965
+ sourceFile.jsDocParsingMode
24955
24966
  );
24956
24967
  }
24957
24968
  const incrementalSourceFile = sourceFile;
@@ -24976,7 +24987,7 @@ var IncrementalParser;
24976
24987
  true,
24977
24988
  sourceFile.scriptKind,
24978
24989
  sourceFile.setExternalModuleIndicator,
24979
- sourceFile.skipNonSemanticJSDoc
24990
+ sourceFile.jsDocParsingMode
24980
24991
  );
24981
24992
  result.commentDirectives = getNewCommentDirectives(
24982
24993
  sourceFile.commentDirectives,
@@ -30934,7 +30945,6 @@ var BuilderState;
30934
30945
  return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);
30935
30946
  }
30936
30947
  function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
30937
- var _a;
30938
30948
  let referencedFiles;
30939
30949
  if (sourceFile.imports && sourceFile.imports.length > 0) {
30940
30950
  const checker = program.getTypeChecker();
@@ -30950,17 +30960,14 @@ var BuilderState;
30950
30960
  addReferencedFile(referencedPath);
30951
30961
  }
30952
30962
  }
30953
- const resolvedTypeReferenceDirectiveNames = (_a = program.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a.get(sourceFile.path);
30954
- if (resolvedTypeReferenceDirectiveNames) {
30955
- resolvedTypeReferenceDirectiveNames.forEach(({ resolvedTypeReferenceDirective }) => {
30956
- if (!resolvedTypeReferenceDirective) {
30957
- return;
30958
- }
30959
- const fileName = resolvedTypeReferenceDirective.resolvedFileName;
30960
- const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);
30961
- addReferencedFile(typeFilePath);
30962
- });
30963
- }
30963
+ program.forEachResolvedTypeReferenceDirective(({ resolvedTypeReferenceDirective }) => {
30964
+ if (!resolvedTypeReferenceDirective) {
30965
+ return;
30966
+ }
30967
+ const fileName = resolvedTypeReferenceDirective.resolvedFileName;
30968
+ const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);
30969
+ addReferencedFile(typeFilePath);
30970
+ }, sourceFile);
30964
30971
  if (sourceFile.moduleAugmentations.length) {
30965
30972
  const checker = program.getTypeChecker();
30966
30973
  for (const moduleName of sourceFile.moduleAugmentations) {
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.3.0-dev.20230921",
5
+ "version": "5.3.0-dev.20230923",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "f3dad2a07d007c40d260f13d6b087a2d5685d12d"
116
+ "gitHead": "956a3630283f9e53ad53adca6c68487192c8701b"
117
117
  }