@typescript-deploys/pr-build 5.3.0-pr-55600-27 → 5.3.0-pr-55864-6
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 +413 -1223
- package/lib/tsserver.js +636 -1307
- package/lib/typescript.d.ts +95 -20
- package/lib/typescript.js +636 -1308
- package/lib/typingsInstaller.js +124 -1042
- package/package.json +2 -2
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.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230925`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3782,24 +3782,6 @@ var ScriptKind = /* @__PURE__ */ ((ScriptKind3) => {
|
|
|
3782
3782
|
ScriptKind3[ScriptKind3["Deferred"] = 7] = "Deferred";
|
|
3783
3783
|
return ScriptKind3;
|
|
3784
3784
|
})(ScriptKind || {});
|
|
3785
|
-
var ScriptTarget = /* @__PURE__ */ ((ScriptTarget3) => {
|
|
3786
|
-
ScriptTarget3[ScriptTarget3["ES3"] = 0] = "ES3";
|
|
3787
|
-
ScriptTarget3[ScriptTarget3["ES5"] = 1] = "ES5";
|
|
3788
|
-
ScriptTarget3[ScriptTarget3["ES2015"] = 2] = "ES2015";
|
|
3789
|
-
ScriptTarget3[ScriptTarget3["ES2016"] = 3] = "ES2016";
|
|
3790
|
-
ScriptTarget3[ScriptTarget3["ES2017"] = 4] = "ES2017";
|
|
3791
|
-
ScriptTarget3[ScriptTarget3["ES2018"] = 5] = "ES2018";
|
|
3792
|
-
ScriptTarget3[ScriptTarget3["ES2019"] = 6] = "ES2019";
|
|
3793
|
-
ScriptTarget3[ScriptTarget3["ES2020"] = 7] = "ES2020";
|
|
3794
|
-
ScriptTarget3[ScriptTarget3["ES2021"] = 8] = "ES2021";
|
|
3795
|
-
ScriptTarget3[ScriptTarget3["ES2022"] = 9] = "ES2022";
|
|
3796
|
-
ScriptTarget3[ScriptTarget3["ES2023"] = 10] = "ES2023";
|
|
3797
|
-
ScriptTarget3[ScriptTarget3["ES2024"] = 11] = "ES2024";
|
|
3798
|
-
ScriptTarget3[ScriptTarget3["ESNext"] = 99] = "ESNext";
|
|
3799
|
-
ScriptTarget3[ScriptTarget3["JSON"] = 100] = "JSON";
|
|
3800
|
-
ScriptTarget3[ScriptTarget3["Latest"] = 99 /* ESNext */] = "Latest";
|
|
3801
|
-
return ScriptTarget3;
|
|
3802
|
-
})(ScriptTarget || {});
|
|
3803
3785
|
var TransformFlags = /* @__PURE__ */ ((TransformFlags3) => {
|
|
3804
3786
|
TransformFlags3[TransformFlags3["None"] = 0] = "None";
|
|
3805
3787
|
TransformFlags3[TransformFlags3["ContainsTypeScript"] = 1] = "ContainsTypeScript";
|
|
@@ -6110,43 +6092,6 @@ var Diagnostics = {
|
|
|
6110
6092
|
The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
|
|
6111
6093
|
The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
|
|
6112
6094
|
_0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
|
|
6113
|
-
_0_is_not_a_valid_character_escape: diag(1496, 1 /* Error */, "_0_is_not_a_valid_character_escape_1496", "'\\{0}' is not a valid character escape."),
|
|
6114
|
-
Unknown_regular_expression_flag: diag(1497, 1 /* Error */, "Unknown_regular_expression_flag_1497", "Unknown regular expression flag."),
|
|
6115
|
-
Duplicate_regular_expression_flag: diag(1498, 1 /* Error */, "Duplicate_regular_expression_flag_1498", "Duplicate regular expression flag."),
|
|
6116
|
-
This_regular_expression_flag_is_only_available_when_targeting_0_or_later: diag(1499, 1 /* Error */, "This_regular_expression_flag_is_only_available_when_targeting_0_or_later_1499", "This regular expression flag is only available when targeting '{0}' or later."),
|
|
6117
|
-
The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously: diag(1500, 1 /* Error */, "The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously_1500", "The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously."),
|
|
6118
|
-
Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later: diag(1501, 1 /* Error */, "Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later_1501", "Named capturing groups are only available when targeting 'ES2018' or later."),
|
|
6119
|
-
Subpattern_flags_must_be_present_when_there_is_a_minus_sign: diag(1502, 1 /* Error */, "Subpattern_flags_must_be_present_when_there_is_a_minus_sign_1502", "Subpattern flags must be present when there is a minus sign."),
|
|
6120
|
-
Incomplete_quantifier_Digit_expected: diag(1503, 1 /* Error */, "Incomplete_quantifier_Digit_expected_1503", "Incomplete quantifier. Digit expected."),
|
|
6121
|
-
Numbers_out_of_order_in_quantifier: diag(1504, 1 /* Error */, "Numbers_out_of_order_in_quantifier_1504", "Numbers out of order in quantifier."),
|
|
6122
|
-
There_is_nothing_available_for_repetition: diag(1505, 1 /* Error */, "There_is_nothing_available_for_repetition_1505", "There is nothing available for repetition."),
|
|
6123
|
-
Unexpected_0_Did_you_mean_to_escape_it_with_backslash: diag(1506, 1 /* Error */, "Unexpected_0_Did_you_mean_to_escape_it_with_backslash_1506", "Unexpected '{0}'. Did you mean to escape it with backslash?"),
|
|
6124
|
-
This_regular_expression_flag_cannot_be_toggled_within_a_subpattern: diag(1507, 1 /* Error */, "This_regular_expression_flag_cannot_be_toggled_within_a_subpattern_1507", "This regular expression flag cannot be toggled within a subpattern."),
|
|
6125
|
-
k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets: diag(1508, 1 /* Error */, "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1508", "'\\k' must be followed by a capturing group name enclosed in angle brackets."),
|
|
6126
|
-
q_is_only_available_inside_character_class: diag(1509, 1 /* Error */, "q_is_only_available_inside_character_class_1509", "'\\q' is only available inside character class."),
|
|
6127
|
-
c_must_be_followed_by_an_ASCII_letter: diag(1510, 1 /* Error */, "c_must_be_followed_by_an_ASCII_letter_1510", "'\\c' must be followed by an ASCII letter."),
|
|
6128
|
-
Undetermined_character_escape: diag(1511, 1 /* Error */, "Undetermined_character_escape_1511", "Undetermined character escape."),
|
|
6129
|
-
Expected_a_capturing_group_name: diag(1512, 1 /* Error */, "Expected_a_capturing_group_name_1512", "Expected a capturing group name."),
|
|
6130
|
-
Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other: diag(1513, 1 /* Error */, "Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other_1513", "Named capturing groups with the same name must be mutually exclusive to each other."),
|
|
6131
|
-
A_character_class_range_must_not_be_bounded_by_another_character_class: diag(1514, 1 /* Error */, "A_character_class_range_must_not_be_bounded_by_another_character_class_1514", "A character class range must not be bounded by another character class."),
|
|
6132
|
-
Range_out_of_order_in_character_class: diag(1515, 1 /* Error */, "Range_out_of_order_in_character_class_1515", "Range out of order in character class."),
|
|
6133
|
-
Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class: diag(1516, 1 /* Error */, "Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_characte_1516", "Anything that would possibly match more than a single character is invalid inside a negated character class."),
|
|
6134
|
-
Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead: diag(1517, 1 /* Error */, "Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead_1517", "Operators must not be mixed within a character class. Wrap it in a nested class instead."),
|
|
6135
|
-
Expected_a_class_set_oprand: diag(1518, 1 /* Error */, "Expected_a_class_set_oprand_1518", "Expected a class set oprand."),
|
|
6136
|
-
q_must_be_followed_by_string_alternatives_enclosed_in_braces: diag(1519, 1 /* Error */, "q_must_be_followed_by_string_alternatives_enclosed_in_braces_1519", "'\\q' must be followed by string alternatives enclosed in braces."),
|
|
6137
|
-
A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash: diag(1520, 1 /* Error */, "A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backs_1520", "A character class must not contain a reserved double punctuator. Did you mean to escape it with backslash?"),
|
|
6138
|
-
Expected_a_Unicode_property_name: diag(1521, 1 /* Error */, "Expected_a_Unicode_property_name_1521", "Expected a Unicode property name."),
|
|
6139
|
-
Unknown_Unicode_property_name: diag(1522, 1 /* Error */, "Unknown_Unicode_property_name_1522", "Unknown Unicode property name."),
|
|
6140
|
-
Expected_a_Unicode_property_value: diag(1523, 1 /* Error */, "Expected_a_Unicode_property_value_1523", "Expected a Unicode property value."),
|
|
6141
|
-
Unknown_Unicode_property_value: diag(1524, 1 /* Error */, "Unknown_Unicode_property_value_1524", "Unknown Unicode property value."),
|
|
6142
|
-
Expected_a_Unicode_property_name_or_value: diag(1525, 1 /* Error */, "Expected_a_Unicode_property_name_or_value_1525", "Expected a Unicode property name or value."),
|
|
6143
|
-
Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set: diag(1526, 1 /* Error */, "Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_t_1526", "Any Unicode property that would possibly match more than a single character is only available when the Unicode Sets (v) flag is set."),
|
|
6144
|
-
Unknown_Unicode_property_name_or_value: diag(1527, 1 /* Error */, "Unknown_Unicode_property_name_or_value_1527", "Unknown Unicode property name or value."),
|
|
6145
|
-
Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: diag(1528, 1 /* Error */, "Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v__1528", "Unicode property value expressions are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),
|
|
6146
|
-
_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces: diag(1529, 1 /* Error */, "_0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces_1529", "'\\{0}' must be followed by a Unicode property value expression enclosed in braces."),
|
|
6147
|
-
There_is_no_capturing_group_named_0_in_this_regular_expression: diag(1530, 1 /* Error */, "There_is_no_capturing_group_named_0_in_this_regular_expression_1530", "There is no capturing group named '{0}' in this regular expression."),
|
|
6148
|
-
A_decimal_escape_must_refer_to_an_existent_capturing_group_There_are_only_0_capturing_groups_in_this_regular_expression: diag(1531, 1 /* Error */, "A_decimal_escape_must_refer_to_an_existent_capturing_group_There_are_only_0_capturing_groups_in_this_1531", "A decimal escape must refer to an existent capturing group. There are only {0} capturing groups in this regular expression."),
|
|
6149
|
-
Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression: diag(1532, 1 /* Error */, "Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression_1532", "Decimal escapes are invalid when there are no capturing groups in a regular expression."),
|
|
6150
6095
|
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."),
|
|
6151
6096
|
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."),
|
|
6152
6097
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -6697,6 +6642,7 @@ var Diagnostics = {
|
|
|
6697
6642
|
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."),
|
|
6698
6643
|
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."),
|
|
6699
6644
|
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."),
|
|
6645
|
+
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."),
|
|
6700
6646
|
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}'."),
|
|
6701
6647
|
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}'."),
|
|
6702
6648
|
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}'."),
|
|
@@ -7744,7 +7690,7 @@ var Diagnostics = {
|
|
|
7744
7690
|
Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"),
|
|
7745
7691
|
Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"),
|
|
7746
7692
|
Could_not_convert_to_anonymous_function: diag(95153, 3 /* Message */, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"),
|
|
7747
|
-
|
|
7693
|
+
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"),
|
|
7748
7694
|
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"),
|
|
7749
7695
|
Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"),
|
|
7750
7696
|
Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
|
|
@@ -7980,26 +7926,6 @@ var textToToken = new Map(Object.entries({
|
|
|
7980
7926
|
"#": 63 /* HashToken */,
|
|
7981
7927
|
"`": 62 /* BacktickToken */
|
|
7982
7928
|
}));
|
|
7983
|
-
var charToRegExpFlag = new Map(Object.entries({
|
|
7984
|
-
d: 1 /* HasIndices */,
|
|
7985
|
-
g: 2 /* Global */,
|
|
7986
|
-
i: 4 /* IgnoreCase */,
|
|
7987
|
-
m: 8 /* Multiline */,
|
|
7988
|
-
s: 16 /* DotAll */,
|
|
7989
|
-
u: 32 /* Unicode */,
|
|
7990
|
-
v: 64 /* UnicodeSets */,
|
|
7991
|
-
y: 128 /* Sticky */
|
|
7992
|
-
}));
|
|
7993
|
-
var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
|
|
7994
|
-
[1 /* HasIndices */, 9 /* ES2022 */],
|
|
7995
|
-
[2 /* Global */, 0 /* ES3 */],
|
|
7996
|
-
[4 /* IgnoreCase */, 0 /* ES3 */],
|
|
7997
|
-
[8 /* Multiline */, 0 /* ES3 */],
|
|
7998
|
-
[16 /* DotAll */, 5 /* ES2018 */],
|
|
7999
|
-
[32 /* Unicode */, 2 /* ES2015 */],
|
|
8000
|
-
[64 /* UnicodeSets */, 11 /* ES2024 */],
|
|
8001
|
-
[128 /* Sticky */, 2 /* ES2015 */]
|
|
8002
|
-
]);
|
|
8003
7929
|
var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 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, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
|
|
8004
7930
|
var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 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, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 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, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
|
|
8005
7931
|
var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 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, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 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, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
|
|
@@ -8008,7 +7934,7 @@ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 18
|
|
|
8008
7934
|
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];
|
|
8009
7935
|
var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
|
|
8010
7936
|
var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
|
|
8011
|
-
var
|
|
7937
|
+
var jsDocSeeOrLink = /@(?:see|link)/i;
|
|
8012
7938
|
function lookupInUnicodeMap(code, map2) {
|
|
8013
7939
|
if (code < map2[0]) {
|
|
8014
7940
|
return false;
|
|
@@ -8050,13 +7976,6 @@ function tokenToString(t) {
|
|
|
8050
7976
|
function stringToToken(s) {
|
|
8051
7977
|
return textToToken.get(s);
|
|
8052
7978
|
}
|
|
8053
|
-
var regExpFlagChars = makeReverseMap(charToRegExpFlag);
|
|
8054
|
-
function characterToRegularExpressionFlag(c) {
|
|
8055
|
-
return charToRegExpFlag.get(c);
|
|
8056
|
-
}
|
|
8057
|
-
function regularExpressionFlagToFirstAvailableLanguageVersion(f) {
|
|
8058
|
-
return regExpFlagToFirstAvailableLanguageVersion.get(f);
|
|
8059
|
-
}
|
|
8060
7979
|
function computeLineStarts(text) {
|
|
8061
7980
|
const result = [];
|
|
8062
7981
|
let pos = 0;
|
|
@@ -8153,11 +8072,8 @@ function isDigit(ch) {
|
|
|
8153
8072
|
function isHexDigit(ch) {
|
|
8154
8073
|
return isDigit(ch) || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */;
|
|
8155
8074
|
}
|
|
8156
|
-
function
|
|
8157
|
-
return
|
|
8158
|
-
}
|
|
8159
|
-
function isWordCharacter(ch) {
|
|
8160
|
-
return isASCIILetter(ch) || isDigit(ch) || ch === 95 /* _ */;
|
|
8075
|
+
function isCodePoint(code) {
|
|
8076
|
+
return code <= 1114111;
|
|
8161
8077
|
}
|
|
8162
8078
|
function isOctalDigit(ch) {
|
|
8163
8079
|
return ch >= 48 /* _0 */ && ch <= 55 /* _7 */;
|
|
@@ -8475,10 +8391,10 @@ function getShebang(text) {
|
|
|
8475
8391
|
}
|
|
8476
8392
|
}
|
|
8477
8393
|
function isIdentifierStart(ch, languageVersion) {
|
|
8478
|
-
return
|
|
8394
|
+
return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
|
|
8479
8395
|
}
|
|
8480
8396
|
function isIdentifierPart(ch, languageVersion, identifierVariant) {
|
|
8481
|
-
return
|
|
8397
|
+
return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || // "-" and ":" are valid in JSX Identifiers
|
|
8482
8398
|
(identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
|
|
8483
8399
|
}
|
|
8484
8400
|
function isIdentifierText(name, languageVersion, identifierVariant) {
|
|
@@ -8504,7 +8420,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8504
8420
|
var tokenFlags;
|
|
8505
8421
|
var commentDirectives;
|
|
8506
8422
|
var inJSDocType = 0;
|
|
8507
|
-
var
|
|
8423
|
+
var scriptKind = 0 /* Unknown */;
|
|
8424
|
+
var jsDocParsingMode = 0 /* ParseAll */;
|
|
8508
8425
|
setText(text, start, length2);
|
|
8509
8426
|
var scanner = {
|
|
8510
8427
|
getTokenFullStart: () => fullStartPos,
|
|
@@ -8548,14 +8465,15 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8548
8465
|
setText,
|
|
8549
8466
|
setScriptTarget,
|
|
8550
8467
|
setLanguageVariant,
|
|
8468
|
+
setScriptKind,
|
|
8469
|
+
setJSDocParsingMode,
|
|
8551
8470
|
setOnError,
|
|
8552
8471
|
resetTokenState,
|
|
8553
8472
|
setTextPos: resetTokenState,
|
|
8554
8473
|
setInJSDocType,
|
|
8555
8474
|
tryScan,
|
|
8556
8475
|
lookAhead,
|
|
8557
|
-
scanRange
|
|
8558
|
-
setSkipNonSemanticJSDoc
|
|
8476
|
+
scanRange
|
|
8559
8477
|
};
|
|
8560
8478
|
if (Debug.isDebugging) {
|
|
8561
8479
|
Object.defineProperty(scanner, "__debugShowCurrentPositionInText", {
|
|
@@ -8797,9 +8715,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8797
8715
|
result += text.substring(start2, pos);
|
|
8798
8716
|
result += scanEscapeSequence(
|
|
8799
8717
|
/*shouldEmitInvalidEscapeError*/
|
|
8800
|
-
true
|
|
8801
|
-
/*isRegularExpression*/
|
|
8802
|
-
false
|
|
8718
|
+
true
|
|
8803
8719
|
);
|
|
8804
8720
|
start2 = pos;
|
|
8805
8721
|
continue;
|
|
@@ -8843,11 +8759,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8843
8759
|
}
|
|
8844
8760
|
if (currChar === 92 /* backslash */) {
|
|
8845
8761
|
contents += text.substring(start2, pos);
|
|
8846
|
-
contents += scanEscapeSequence(
|
|
8847
|
-
shouldEmitInvalidEscapeError,
|
|
8848
|
-
/*isRegularExpression*/
|
|
8849
|
-
false
|
|
8850
|
-
);
|
|
8762
|
+
contents += scanEscapeSequence(shouldEmitInvalidEscapeError);
|
|
8851
8763
|
start2 = pos;
|
|
8852
8764
|
continue;
|
|
8853
8765
|
}
|
|
@@ -8867,7 +8779,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8867
8779
|
tokenValue = contents;
|
|
8868
8780
|
return resultingToken;
|
|
8869
8781
|
}
|
|
8870
|
-
function scanEscapeSequence(shouldEmitInvalidEscapeError
|
|
8782
|
+
function scanEscapeSequence(shouldEmitInvalidEscapeError) {
|
|
8871
8783
|
const start2 = pos;
|
|
8872
8784
|
pos++;
|
|
8873
8785
|
if (pos >= end) {
|
|
@@ -8895,7 +8807,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8895
8807
|
pos++;
|
|
8896
8808
|
}
|
|
8897
8809
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
8898
|
-
if (
|
|
8810
|
+
if (shouldEmitInvalidEscapeError) {
|
|
8899
8811
|
const code = parseInt(text.substring(start2 + 1, pos), 8);
|
|
8900
8812
|
error(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start2, pos - start2, "\\x" + code.toString(16).padStart(2, "0"));
|
|
8901
8813
|
return String.fromCharCode(code);
|
|
@@ -8904,7 +8816,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8904
8816
|
case 56 /* _8 */:
|
|
8905
8817
|
case 57 /* _9 */:
|
|
8906
8818
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
8907
|
-
if (
|
|
8819
|
+
if (shouldEmitInvalidEscapeError) {
|
|
8908
8820
|
error(Diagnostics.Escape_sequence_0_is_not_allowed, start2, pos - start2, text.substring(start2, pos));
|
|
8909
8821
|
return String.fromCharCode(ch);
|
|
8910
8822
|
}
|
|
@@ -8926,42 +8838,62 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8926
8838
|
case 34 /* doubleQuote */:
|
|
8927
8839
|
return '"';
|
|
8928
8840
|
case 117 /* u */:
|
|
8929
|
-
if (
|
|
8930
|
-
pos
|
|
8931
|
-
|
|
8841
|
+
if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
|
|
8842
|
+
pos++;
|
|
8843
|
+
const escapedValueString = scanMinimumNumberOfHexDigits(
|
|
8844
|
+
1,
|
|
8845
|
+
/*canHaveSeparators*/
|
|
8846
|
+
false
|
|
8847
|
+
);
|
|
8848
|
+
const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
|
|
8849
|
+
if (escapedValue < 0) {
|
|
8850
|
+
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
8851
|
+
if (shouldEmitInvalidEscapeError) {
|
|
8852
|
+
error(Diagnostics.Hexadecimal_digit_expected);
|
|
8853
|
+
}
|
|
8854
|
+
return text.substring(start2, pos);
|
|
8855
|
+
}
|
|
8856
|
+
if (!isCodePoint(escapedValue)) {
|
|
8857
|
+
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
8858
|
+
if (shouldEmitInvalidEscapeError) {
|
|
8859
|
+
error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
|
|
8860
|
+
}
|
|
8861
|
+
return text.substring(start2, pos);
|
|
8862
|
+
}
|
|
8863
|
+
if (pos >= end) {
|
|
8864
|
+
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
8865
|
+
if (shouldEmitInvalidEscapeError) {
|
|
8866
|
+
error(Diagnostics.Unexpected_end_of_text);
|
|
8867
|
+
}
|
|
8868
|
+
return text.substring(start2, pos);
|
|
8869
|
+
}
|
|
8870
|
+
if (text.charCodeAt(pos) !== 125 /* closeBrace */) {
|
|
8871
|
+
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
8872
|
+
if (shouldEmitInvalidEscapeError) {
|
|
8873
|
+
error(Diagnostics.Unterminated_Unicode_escape_sequence);
|
|
8874
|
+
}
|
|
8875
|
+
return text.substring(start2, pos);
|
|
8876
|
+
}
|
|
8877
|
+
pos++;
|
|
8878
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
8879
|
+
return utf16EncodeAsString(escapedValue);
|
|
8932
8880
|
}
|
|
8933
8881
|
for (; pos < start2 + 6; pos++) {
|
|
8934
8882
|
if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
|
|
8935
8883
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
8936
|
-
if (
|
|
8884
|
+
if (shouldEmitInvalidEscapeError) {
|
|
8937
8885
|
error(Diagnostics.Hexadecimal_digit_expected);
|
|
8938
8886
|
}
|
|
8939
8887
|
return text.substring(start2, pos);
|
|
8940
8888
|
}
|
|
8941
8889
|
}
|
|
8942
8890
|
tokenFlags |= 1024 /* UnicodeEscape */;
|
|
8943
|
-
|
|
8944
|
-
const escapedValueString = String.fromCharCode(escapedValue);
|
|
8945
|
-
if (isRegularExpression && shouldEmitInvalidEscapeError && escapedValue >= 55296 && escapedValue <= 56319 && pos + 6 < end && text.substring(pos, pos + 2) === "\\u" && text.charCodeAt(pos + 2) !== 123 /* openBrace */) {
|
|
8946
|
-
const nextStart = pos;
|
|
8947
|
-
let nextPos = pos + 2;
|
|
8948
|
-
for (; nextPos < nextStart + 6; nextPos++) {
|
|
8949
|
-
if (!isHexDigit(text.charCodeAt(pos))) {
|
|
8950
|
-
return escapedValueString;
|
|
8951
|
-
}
|
|
8952
|
-
}
|
|
8953
|
-
const nextEscapedValue = parseInt(text.substring(nextStart + 2, nextPos), 16);
|
|
8954
|
-
if (nextEscapedValue >= 56320 && nextEscapedValue <= 57343) {
|
|
8955
|
-
pos = nextPos;
|
|
8956
|
-
return escapedValueString + String.fromCharCode(nextEscapedValue);
|
|
8957
|
-
}
|
|
8958
|
-
}
|
|
8959
|
-
return escapedValueString;
|
|
8891
|
+
return String.fromCharCode(parseInt(text.substring(start2 + 2, pos), 16));
|
|
8960
8892
|
case 120 /* x */:
|
|
8961
8893
|
for (; pos < start2 + 4; pos++) {
|
|
8962
8894
|
if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
|
|
8963
8895
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
8964
|
-
if (
|
|
8896
|
+
if (shouldEmitInvalidEscapeError) {
|
|
8965
8897
|
error(Diagnostics.Hexadecimal_digit_expected);
|
|
8966
8898
|
}
|
|
8967
8899
|
return text.substring(start2, pos);
|
|
@@ -8978,16 +8910,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8978
8910
|
case 8233 /* paragraphSeparator */:
|
|
8979
8911
|
return "";
|
|
8980
8912
|
default:
|
|
8981
|
-
if (isRegularExpression && (shouldEmitInvalidEscapeError || isIdentifierPart(ch, languageVersion))) {
|
|
8982
|
-
error(Diagnostics._0_is_not_a_valid_character_escape, pos - 2, 2, String.fromCharCode(ch));
|
|
8983
|
-
}
|
|
8984
8913
|
return String.fromCharCode(ch);
|
|
8985
8914
|
}
|
|
8986
8915
|
}
|
|
8987
|
-
function scanExtendedUnicodeEscape(
|
|
8988
|
-
const start2 = pos;
|
|
8989
|
-
pos += 3;
|
|
8990
|
-
const escapedStart = pos;
|
|
8916
|
+
function scanExtendedUnicodeEscape() {
|
|
8991
8917
|
const escapedValueString = scanMinimumNumberOfHexDigits(
|
|
8992
8918
|
1,
|
|
8993
8919
|
/*canHaveSeparators*/
|
|
@@ -8996,34 +8922,24 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8996
8922
|
const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
|
|
8997
8923
|
let isInvalidExtendedEscape = false;
|
|
8998
8924
|
if (escapedValue < 0) {
|
|
8999
|
-
|
|
9000
|
-
error(Diagnostics.Hexadecimal_digit_expected);
|
|
9001
|
-
}
|
|
8925
|
+
error(Diagnostics.Hexadecimal_digit_expected);
|
|
9002
8926
|
isInvalidExtendedEscape = true;
|
|
9003
8927
|
} else if (escapedValue > 1114111) {
|
|
9004
|
-
|
|
9005
|
-
error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, escapedStart, pos - escapedStart);
|
|
9006
|
-
}
|
|
8928
|
+
error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
|
|
9007
8929
|
isInvalidExtendedEscape = true;
|
|
9008
8930
|
}
|
|
9009
8931
|
if (pos >= end) {
|
|
9010
|
-
|
|
9011
|
-
error(Diagnostics.Unexpected_end_of_text);
|
|
9012
|
-
}
|
|
8932
|
+
error(Diagnostics.Unexpected_end_of_text);
|
|
9013
8933
|
isInvalidExtendedEscape = true;
|
|
9014
8934
|
} else if (text.charCodeAt(pos) === 125 /* closeBrace */) {
|
|
9015
8935
|
pos++;
|
|
9016
8936
|
} else {
|
|
9017
|
-
|
|
9018
|
-
error(Diagnostics.Unterminated_Unicode_escape_sequence);
|
|
9019
|
-
}
|
|
8937
|
+
error(Diagnostics.Unterminated_Unicode_escape_sequence);
|
|
9020
8938
|
isInvalidExtendedEscape = true;
|
|
9021
8939
|
}
|
|
9022
8940
|
if (isInvalidExtendedEscape) {
|
|
9023
|
-
|
|
9024
|
-
return text.substring(start2, pos);
|
|
8941
|
+
return "";
|
|
9025
8942
|
}
|
|
9026
|
-
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
9027
8943
|
return utf16EncodeAsString(escapedValue);
|
|
9028
8944
|
}
|
|
9029
8945
|
function peekUnicodeEscape() {
|
|
@@ -9065,6 +8981,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9065
8981
|
} else if (ch === 92 /* backslash */) {
|
|
9066
8982
|
ch = peekExtendedUnicodeEscape();
|
|
9067
8983
|
if (ch >= 0 && isIdentifierPart(ch, languageVersion)) {
|
|
8984
|
+
pos += 3;
|
|
8985
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
9068
8986
|
result += scanExtendedUnicodeEscape();
|
|
9069
8987
|
start2 = pos;
|
|
9070
8988
|
continue;
|
|
@@ -9343,7 +9261,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9343
9261
|
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
9344
9262
|
}
|
|
9345
9263
|
}
|
|
9346
|
-
if (isJSDoc2 && (
|
|
9264
|
+
if (isJSDoc2 && shouldParseJSDoc()) {
|
|
9347
9265
|
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
9348
9266
|
}
|
|
9349
9267
|
commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
|
|
@@ -9535,6 +9453,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9535
9453
|
case 92 /* backslash */:
|
|
9536
9454
|
const extendedCookedChar = peekExtendedUnicodeEscape();
|
|
9537
9455
|
if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
|
|
9456
|
+
pos += 3;
|
|
9457
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
9538
9458
|
tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
9539
9459
|
return token = getIdentifierToken();
|
|
9540
9460
|
}
|
|
@@ -9550,7 +9470,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9550
9470
|
return token = 0 /* Unknown */;
|
|
9551
9471
|
case 35 /* hash */:
|
|
9552
9472
|
if (pos !== 0 && text[pos + 1] === "!") {
|
|
9553
|
-
error(Diagnostics.can_only_be_used_at_the_start_of_a_file
|
|
9473
|
+
error(Diagnostics.can_only_be_used_at_the_start_of_a_file);
|
|
9554
9474
|
pos++;
|
|
9555
9475
|
return token = 0 /* Unknown */;
|
|
9556
9476
|
}
|
|
@@ -9559,6 +9479,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9559
9479
|
pos++;
|
|
9560
9480
|
const extendedCookedChar2 = peekExtendedUnicodeEscape();
|
|
9561
9481
|
if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) {
|
|
9482
|
+
pos += 3;
|
|
9483
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
9562
9484
|
tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
9563
9485
|
return token = 81 /* PrivateIdentifier */;
|
|
9564
9486
|
}
|
|
@@ -9598,6 +9520,21 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9598
9520
|
}
|
|
9599
9521
|
}
|
|
9600
9522
|
}
|
|
9523
|
+
function shouldParseJSDoc() {
|
|
9524
|
+
switch (jsDocParsingMode) {
|
|
9525
|
+
case 0 /* ParseAll */:
|
|
9526
|
+
return true;
|
|
9527
|
+
case 1 /* ParseNone */:
|
|
9528
|
+
return false;
|
|
9529
|
+
}
|
|
9530
|
+
if (scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */) {
|
|
9531
|
+
return true;
|
|
9532
|
+
}
|
|
9533
|
+
if (jsDocParsingMode === 3 /* ParseForTypeInfo */) {
|
|
9534
|
+
return false;
|
|
9535
|
+
}
|
|
9536
|
+
return jsDocSeeOrLink.test(text.slice(fullStartPos, pos));
|
|
9537
|
+
}
|
|
9601
9538
|
function reScanInvalidIdentifier() {
|
|
9602
9539
|
Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
|
|
9603
9540
|
pos = tokenStart = fullStartPos;
|
|
@@ -9681,841 +9618,14 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9681
9618
|
}
|
|
9682
9619
|
p++;
|
|
9683
9620
|
}
|
|
9684
|
-
|
|
9685
|
-
const endOfBody = p - (isUnterminated ? 0 : 1);
|
|
9686
|
-
let regExpFlags = 0 /* None */;
|
|
9687
|
-
while (p < end) {
|
|
9688
|
-
const ch = text.charCodeAt(p);
|
|
9689
|
-
if (!isIdentifierPart(ch, languageVersion)) {
|
|
9690
|
-
break;
|
|
9691
|
-
}
|
|
9692
|
-
const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
|
|
9693
|
-
if (flag === void 0) {
|
|
9694
|
-
error(Diagnostics.Unknown_regular_expression_flag, p, 1);
|
|
9695
|
-
} else if (regExpFlags & flag) {
|
|
9696
|
-
error(Diagnostics.Duplicate_regular_expression_flag, p, 1);
|
|
9697
|
-
} else if (((regExpFlags | flag) & 96 /* UnicodeMode */) === 96 /* UnicodeMode */) {
|
|
9698
|
-
error(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1);
|
|
9699
|
-
} else {
|
|
9700
|
-
regExpFlags |= flag;
|
|
9701
|
-
const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
|
|
9702
|
-
if (languageVersion < availableFrom) {
|
|
9703
|
-
error(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, p, 1, ScriptTarget[availableFrom]);
|
|
9704
|
-
}
|
|
9705
|
-
}
|
|
9621
|
+
while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {
|
|
9706
9622
|
p++;
|
|
9707
9623
|
}
|
|
9708
|
-
pos =
|
|
9709
|
-
const saveTokenPos = tokenStart;
|
|
9710
|
-
const saveTokenFlags = tokenFlags;
|
|
9711
|
-
scanRegularExpressionWorker(text.slice(0, endOfBody), endOfBody, regExpFlags, isUnterminated);
|
|
9712
|
-
if (!isUnterminated) {
|
|
9713
|
-
pos = p;
|
|
9714
|
-
}
|
|
9715
|
-
tokenStart = saveTokenPos;
|
|
9716
|
-
tokenFlags = saveTokenFlags;
|
|
9624
|
+
pos = p;
|
|
9717
9625
|
tokenValue = text.substring(tokenStart, pos);
|
|
9718
9626
|
token = 14 /* RegularExpressionLiteral */;
|
|
9719
9627
|
}
|
|
9720
9628
|
return token;
|
|
9721
|
-
function scanRegularExpressionWorker(text2, end2, regExpFlags, isUnterminated) {
|
|
9722
|
-
const unicodeMode = !!(regExpFlags & 96 /* UnicodeMode */);
|
|
9723
|
-
const unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */);
|
|
9724
|
-
let mayContainStrings = false;
|
|
9725
|
-
let numberOfCapturingGroups = 0;
|
|
9726
|
-
const groupSpecifiers = /* @__PURE__ */ new Set();
|
|
9727
|
-
const groupNameReferences = [];
|
|
9728
|
-
const decimalEscapes = [];
|
|
9729
|
-
const namedCapturingGroups = [];
|
|
9730
|
-
function scanDisjunction(isInGroup) {
|
|
9731
|
-
while (true) {
|
|
9732
|
-
namedCapturingGroups.push(/* @__PURE__ */ new Set());
|
|
9733
|
-
scanAlternative(isInGroup);
|
|
9734
|
-
namedCapturingGroups.pop();
|
|
9735
|
-
if (text2.charCodeAt(pos) !== 124 /* bar */) {
|
|
9736
|
-
return;
|
|
9737
|
-
}
|
|
9738
|
-
pos++;
|
|
9739
|
-
}
|
|
9740
|
-
}
|
|
9741
|
-
function scanAlternative(isInGroup) {
|
|
9742
|
-
let isPreviousTermQuantifiable = false;
|
|
9743
|
-
while (pos < end2) {
|
|
9744
|
-
const start2 = pos;
|
|
9745
|
-
const ch = text2.charCodeAt(pos);
|
|
9746
|
-
switch (ch) {
|
|
9747
|
-
case 94 /* caret */:
|
|
9748
|
-
case 36 /* $ */:
|
|
9749
|
-
pos++;
|
|
9750
|
-
isPreviousTermQuantifiable = false;
|
|
9751
|
-
break;
|
|
9752
|
-
case 92 /* backslash */:
|
|
9753
|
-
pos++;
|
|
9754
|
-
switch (text2.charCodeAt(pos)) {
|
|
9755
|
-
case 98 /* b */:
|
|
9756
|
-
case 66 /* B */:
|
|
9757
|
-
pos++;
|
|
9758
|
-
isPreviousTermQuantifiable = false;
|
|
9759
|
-
break;
|
|
9760
|
-
default:
|
|
9761
|
-
scanAtomEscape();
|
|
9762
|
-
isPreviousTermQuantifiable = true;
|
|
9763
|
-
break;
|
|
9764
|
-
}
|
|
9765
|
-
break;
|
|
9766
|
-
case 40 /* openParen */:
|
|
9767
|
-
pos++;
|
|
9768
|
-
if (text2.charCodeAt(pos) === 63 /* question */) {
|
|
9769
|
-
pos++;
|
|
9770
|
-
switch (text2.charCodeAt(pos)) {
|
|
9771
|
-
case 61 /* equals */:
|
|
9772
|
-
case 33 /* exclamation */:
|
|
9773
|
-
pos++;
|
|
9774
|
-
isPreviousTermQuantifiable = false;
|
|
9775
|
-
break;
|
|
9776
|
-
case 60 /* lessThan */:
|
|
9777
|
-
const groupNameStart = pos;
|
|
9778
|
-
pos++;
|
|
9779
|
-
switch (text2.charCodeAt(pos)) {
|
|
9780
|
-
case 61 /* equals */:
|
|
9781
|
-
case 33 /* exclamation */:
|
|
9782
|
-
pos++;
|
|
9783
|
-
isPreviousTermQuantifiable = false;
|
|
9784
|
-
break;
|
|
9785
|
-
default:
|
|
9786
|
-
scanGroupName(
|
|
9787
|
-
/*isReference*/
|
|
9788
|
-
false
|
|
9789
|
-
);
|
|
9790
|
-
scanExpectedChar(62 /* greaterThan */);
|
|
9791
|
-
if (languageVersion < 5 /* ES2018 */) {
|
|
9792
|
-
error(Diagnostics.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, groupNameStart, pos - groupNameStart);
|
|
9793
|
-
}
|
|
9794
|
-
numberOfCapturingGroups++;
|
|
9795
|
-
isPreviousTermQuantifiable = true;
|
|
9796
|
-
break;
|
|
9797
|
-
}
|
|
9798
|
-
break;
|
|
9799
|
-
default:
|
|
9800
|
-
const start3 = pos;
|
|
9801
|
-
const setFlags = scanPatternModifiers();
|
|
9802
|
-
if (text2.charCodeAt(pos) === 45 /* minus */) {
|
|
9803
|
-
pos++;
|
|
9804
|
-
scanPatternModifiers(setFlags);
|
|
9805
|
-
if (pos === start3 + 1) {
|
|
9806
|
-
error(Diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, start3, pos - start3);
|
|
9807
|
-
}
|
|
9808
|
-
}
|
|
9809
|
-
scanExpectedChar(58 /* colon */);
|
|
9810
|
-
isPreviousTermQuantifiable = true;
|
|
9811
|
-
break;
|
|
9812
|
-
}
|
|
9813
|
-
} else {
|
|
9814
|
-
numberOfCapturingGroups++;
|
|
9815
|
-
isPreviousTermQuantifiable = true;
|
|
9816
|
-
}
|
|
9817
|
-
scanDisjunction(
|
|
9818
|
-
/*isInGroup*/
|
|
9819
|
-
true
|
|
9820
|
-
);
|
|
9821
|
-
scanExpectedChar(41 /* closeParen */);
|
|
9822
|
-
break;
|
|
9823
|
-
case 123 /* openBrace */:
|
|
9824
|
-
pos++;
|
|
9825
|
-
const digitsStart = pos;
|
|
9826
|
-
scanDigits();
|
|
9827
|
-
const min2 = tokenValue;
|
|
9828
|
-
if (text2.charCodeAt(pos) === 44 /* comma */) {
|
|
9829
|
-
pos++;
|
|
9830
|
-
scanDigits();
|
|
9831
|
-
const max = tokenValue;
|
|
9832
|
-
if (!min2) {
|
|
9833
|
-
if (max || text2.charCodeAt(pos) === 125 /* closeBrace */) {
|
|
9834
|
-
error(Diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0);
|
|
9835
|
-
} else {
|
|
9836
|
-
if (unicodeMode) {
|
|
9837
|
-
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
|
|
9838
|
-
}
|
|
9839
|
-
isPreviousTermQuantifiable = true;
|
|
9840
|
-
break;
|
|
9841
|
-
}
|
|
9842
|
-
}
|
|
9843
|
-
if (max && Number.parseInt(min2) > Number.parseInt(max)) {
|
|
9844
|
-
error(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart);
|
|
9845
|
-
}
|
|
9846
|
-
} else if (!min2) {
|
|
9847
|
-
if (unicodeMode) {
|
|
9848
|
-
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start2, 1, String.fromCharCode(ch));
|
|
9849
|
-
}
|
|
9850
|
-
isPreviousTermQuantifiable = true;
|
|
9851
|
-
break;
|
|
9852
|
-
}
|
|
9853
|
-
scanExpectedChar(125 /* closeBrace */);
|
|
9854
|
-
pos--;
|
|
9855
|
-
case 42 /* asterisk */:
|
|
9856
|
-
case 43 /* plus */:
|
|
9857
|
-
case 63 /* question */:
|
|
9858
|
-
pos++;
|
|
9859
|
-
if (text2.charCodeAt(pos) === 63 /* question */) {
|
|
9860
|
-
pos++;
|
|
9861
|
-
}
|
|
9862
|
-
if (!isPreviousTermQuantifiable) {
|
|
9863
|
-
error(Diagnostics.There_is_nothing_available_for_repetition, start2, pos - start2);
|
|
9864
|
-
}
|
|
9865
|
-
isPreviousTermQuantifiable = false;
|
|
9866
|
-
break;
|
|
9867
|
-
case 46 /* dot */:
|
|
9868
|
-
pos++;
|
|
9869
|
-
isPreviousTermQuantifiable = true;
|
|
9870
|
-
break;
|
|
9871
|
-
case 91 /* openBracket */:
|
|
9872
|
-
pos++;
|
|
9873
|
-
if (unicodeSetsMode) {
|
|
9874
|
-
scanClassSetExpression();
|
|
9875
|
-
} else {
|
|
9876
|
-
scanClassRanges();
|
|
9877
|
-
}
|
|
9878
|
-
scanExpectedChar(93 /* closeBracket */);
|
|
9879
|
-
isPreviousTermQuantifiable = true;
|
|
9880
|
-
break;
|
|
9881
|
-
case 41 /* closeParen */:
|
|
9882
|
-
if (isInGroup) {
|
|
9883
|
-
return;
|
|
9884
|
-
}
|
|
9885
|
-
case 93 /* closeBracket */:
|
|
9886
|
-
case 125 /* closeBrace */:
|
|
9887
|
-
if (isUnterminated && !isInGroup) {
|
|
9888
|
-
return;
|
|
9889
|
-
}
|
|
9890
|
-
if (unicodeMode) {
|
|
9891
|
-
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
9892
|
-
}
|
|
9893
|
-
pos++;
|
|
9894
|
-
isPreviousTermQuantifiable = true;
|
|
9895
|
-
break;
|
|
9896
|
-
case 47 /* slash */:
|
|
9897
|
-
case 124 /* bar */:
|
|
9898
|
-
return;
|
|
9899
|
-
default:
|
|
9900
|
-
scanSourceCharacter();
|
|
9901
|
-
isPreviousTermQuantifiable = true;
|
|
9902
|
-
break;
|
|
9903
|
-
}
|
|
9904
|
-
}
|
|
9905
|
-
}
|
|
9906
|
-
function scanPatternModifiers(currFlags = 0 /* None */) {
|
|
9907
|
-
while (pos < end2) {
|
|
9908
|
-
const ch = text2.charCodeAt(pos);
|
|
9909
|
-
if (!isIdentifierPart(ch, languageVersion)) {
|
|
9910
|
-
break;
|
|
9911
|
-
}
|
|
9912
|
-
const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
|
|
9913
|
-
if (flag === void 0) {
|
|
9914
|
-
error(Diagnostics.Unknown_regular_expression_flag, pos, 1);
|
|
9915
|
-
} else if (currFlags & flag) {
|
|
9916
|
-
error(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
|
|
9917
|
-
} else if (!(flag & 28 /* Modifiers */)) {
|
|
9918
|
-
error(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, 1);
|
|
9919
|
-
} else {
|
|
9920
|
-
currFlags |= flag;
|
|
9921
|
-
const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
|
|
9922
|
-
if (languageVersion < availableFrom) {
|
|
9923
|
-
error(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, 1, ScriptTarget[availableFrom]);
|
|
9924
|
-
}
|
|
9925
|
-
}
|
|
9926
|
-
pos++;
|
|
9927
|
-
}
|
|
9928
|
-
return currFlags;
|
|
9929
|
-
}
|
|
9930
|
-
function scanAtomEscape() {
|
|
9931
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
9932
|
-
switch (text2.charCodeAt(pos)) {
|
|
9933
|
-
case 107 /* k */:
|
|
9934
|
-
pos++;
|
|
9935
|
-
if (text2.charCodeAt(pos) === 60 /* lessThan */) {
|
|
9936
|
-
pos++;
|
|
9937
|
-
scanGroupName(
|
|
9938
|
-
/*isReference*/
|
|
9939
|
-
true
|
|
9940
|
-
);
|
|
9941
|
-
scanExpectedChar(62 /* greaterThan */);
|
|
9942
|
-
} else if (unicodeMode) {
|
|
9943
|
-
error(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2);
|
|
9944
|
-
}
|
|
9945
|
-
break;
|
|
9946
|
-
case 113 /* q */:
|
|
9947
|
-
if (unicodeSetsMode) {
|
|
9948
|
-
pos++;
|
|
9949
|
-
error(Diagnostics.q_is_only_available_inside_character_class, pos - 2, 2);
|
|
9950
|
-
break;
|
|
9951
|
-
}
|
|
9952
|
-
default:
|
|
9953
|
-
scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape();
|
|
9954
|
-
break;
|
|
9955
|
-
}
|
|
9956
|
-
}
|
|
9957
|
-
function scanDecimalEscape() {
|
|
9958
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
9959
|
-
const ch = text2.charCodeAt(pos);
|
|
9960
|
-
if (ch >= 49 /* _1 */ && ch <= 57 /* _9 */) {
|
|
9961
|
-
const start2 = pos;
|
|
9962
|
-
scanDigits();
|
|
9963
|
-
decimalEscapes.push({ pos: start2, end: pos, value: +tokenValue });
|
|
9964
|
-
return true;
|
|
9965
|
-
}
|
|
9966
|
-
return false;
|
|
9967
|
-
}
|
|
9968
|
-
function scanCharacterEscape() {
|
|
9969
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
9970
|
-
let ch = text2.charCodeAt(pos);
|
|
9971
|
-
switch (ch) {
|
|
9972
|
-
case 99 /* c */:
|
|
9973
|
-
pos++;
|
|
9974
|
-
ch = text2.charCodeAt(pos);
|
|
9975
|
-
if (isASCIILetter(ch)) {
|
|
9976
|
-
pos++;
|
|
9977
|
-
return String.fromCharCode(ch & 31);
|
|
9978
|
-
}
|
|
9979
|
-
if (unicodeMode) {
|
|
9980
|
-
error(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2);
|
|
9981
|
-
}
|
|
9982
|
-
return String.fromCharCode(ch);
|
|
9983
|
-
case 94 /* caret */:
|
|
9984
|
-
case 36 /* $ */:
|
|
9985
|
-
case 47 /* slash */:
|
|
9986
|
-
case 92 /* backslash */:
|
|
9987
|
-
case 46 /* dot */:
|
|
9988
|
-
case 42 /* asterisk */:
|
|
9989
|
-
case 43 /* plus */:
|
|
9990
|
-
case 63 /* question */:
|
|
9991
|
-
case 40 /* openParen */:
|
|
9992
|
-
case 41 /* closeParen */:
|
|
9993
|
-
case 91 /* openBracket */:
|
|
9994
|
-
case 93 /* closeBracket */:
|
|
9995
|
-
case 123 /* openBrace */:
|
|
9996
|
-
case 125 /* closeBrace */:
|
|
9997
|
-
case 124 /* bar */:
|
|
9998
|
-
pos++;
|
|
9999
|
-
return String.fromCharCode(ch);
|
|
10000
|
-
default:
|
|
10001
|
-
if (pos >= end2) {
|
|
10002
|
-
error(Diagnostics.Undetermined_character_escape, pos - 1, 1, ch);
|
|
10003
|
-
return "\\";
|
|
10004
|
-
}
|
|
10005
|
-
pos--;
|
|
10006
|
-
return scanEscapeSequence(
|
|
10007
|
-
/*shouldEmitInvalidEscapeError*/
|
|
10008
|
-
unicodeMode,
|
|
10009
|
-
/*isRegularExpression*/
|
|
10010
|
-
true
|
|
10011
|
-
);
|
|
10012
|
-
}
|
|
10013
|
-
}
|
|
10014
|
-
function scanGroupName(isReference) {
|
|
10015
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 60 /* lessThan */);
|
|
10016
|
-
tokenStart = pos;
|
|
10017
|
-
scanIdentifier(codePointAt(text2, pos), languageVersion);
|
|
10018
|
-
if (pos === tokenStart) {
|
|
10019
|
-
error(Diagnostics.Expected_a_capturing_group_name);
|
|
10020
|
-
} else if (isReference) {
|
|
10021
|
-
groupNameReferences.push({ pos: tokenStart, end: pos, name: tokenValue });
|
|
10022
|
-
} else if (namedCapturingGroups.some((group2) => group2.has(tokenValue))) {
|
|
10023
|
-
error(Diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, tokenStart, pos - tokenStart);
|
|
10024
|
-
} else {
|
|
10025
|
-
last(namedCapturingGroups).add(tokenValue);
|
|
10026
|
-
groupSpecifiers.add(tokenValue);
|
|
10027
|
-
}
|
|
10028
|
-
}
|
|
10029
|
-
function isClassContentExit(ch) {
|
|
10030
|
-
return ch === 93 /* closeBracket */ || pos >= end2;
|
|
10031
|
-
}
|
|
10032
|
-
function scanClassRanges() {
|
|
10033
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
|
|
10034
|
-
if (text2.charCodeAt(pos) === 94 /* caret */) {
|
|
10035
|
-
pos++;
|
|
10036
|
-
}
|
|
10037
|
-
while (pos < end2) {
|
|
10038
|
-
const ch = text2.charCodeAt(pos);
|
|
10039
|
-
if (isClassContentExit(ch)) {
|
|
10040
|
-
return;
|
|
10041
|
-
}
|
|
10042
|
-
const minStart = pos;
|
|
10043
|
-
const minCharacter = scanClassAtom();
|
|
10044
|
-
if (text2.charCodeAt(pos) === 45 /* minus */) {
|
|
10045
|
-
pos++;
|
|
10046
|
-
const ch2 = text2.charCodeAt(pos);
|
|
10047
|
-
if (isClassContentExit(ch2)) {
|
|
10048
|
-
return;
|
|
10049
|
-
}
|
|
10050
|
-
if (!minCharacter) {
|
|
10051
|
-
error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, minStart, pos - 1 - minStart);
|
|
10052
|
-
}
|
|
10053
|
-
const maxStart = pos;
|
|
10054
|
-
const maxCharacter = scanClassAtom();
|
|
10055
|
-
if (!maxCharacter) {
|
|
10056
|
-
error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, maxStart, pos - maxStart);
|
|
10057
|
-
continue;
|
|
10058
|
-
}
|
|
10059
|
-
if (!minCharacter) {
|
|
10060
|
-
continue;
|
|
10061
|
-
}
|
|
10062
|
-
const minCharacterValue = codePointAt(minCharacter, 0);
|
|
10063
|
-
const maxCharacterValue = codePointAt(maxCharacter, 0);
|
|
10064
|
-
if (minCharacter.length === charSize(minCharacterValue) && maxCharacter.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
|
|
10065
|
-
error(Diagnostics.Range_out_of_order_in_character_class, minStart, pos - minStart);
|
|
10066
|
-
}
|
|
10067
|
-
}
|
|
10068
|
-
}
|
|
10069
|
-
}
|
|
10070
|
-
function scanClassSetExpression() {
|
|
10071
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
|
|
10072
|
-
let isCharacterComplement = false;
|
|
10073
|
-
if (text2.charCodeAt(pos) === 94 /* caret */) {
|
|
10074
|
-
pos++;
|
|
10075
|
-
isCharacterComplement = true;
|
|
10076
|
-
}
|
|
10077
|
-
let expressionMayContainStrings = false;
|
|
10078
|
-
let ch = text2.charCodeAt(pos);
|
|
10079
|
-
if (isClassContentExit(ch)) {
|
|
10080
|
-
return;
|
|
10081
|
-
}
|
|
10082
|
-
let start2 = pos;
|
|
10083
|
-
let oprand;
|
|
10084
|
-
switch (text2.slice(pos, pos + 2)) {
|
|
10085
|
-
case "--":
|
|
10086
|
-
case "&&":
|
|
10087
|
-
error(Diagnostics.Expected_a_class_set_oprand);
|
|
10088
|
-
mayContainStrings = false;
|
|
10089
|
-
break;
|
|
10090
|
-
default:
|
|
10091
|
-
oprand = scanClassSetOprand();
|
|
10092
|
-
break;
|
|
10093
|
-
}
|
|
10094
|
-
switch (text2.charCodeAt(pos)) {
|
|
10095
|
-
case 45 /* minus */:
|
|
10096
|
-
if (text2.charCodeAt(pos + 1) === 45 /* minus */) {
|
|
10097
|
-
if (isCharacterComplement && mayContainStrings) {
|
|
10098
|
-
error(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
|
|
10099
|
-
}
|
|
10100
|
-
expressionMayContainStrings = mayContainStrings;
|
|
10101
|
-
scanClassSetSubExpression(3 /* ClassSubtraction */);
|
|
10102
|
-
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
10103
|
-
return;
|
|
10104
|
-
}
|
|
10105
|
-
break;
|
|
10106
|
-
case 38 /* ampersand */:
|
|
10107
|
-
if (text2.charCodeAt(pos + 1) === 38 /* ampersand */) {
|
|
10108
|
-
scanClassSetSubExpression(2 /* ClassIntersection */);
|
|
10109
|
-
if (isCharacterComplement && mayContainStrings) {
|
|
10110
|
-
error(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
|
|
10111
|
-
}
|
|
10112
|
-
expressionMayContainStrings = mayContainStrings;
|
|
10113
|
-
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
10114
|
-
return;
|
|
10115
|
-
} else {
|
|
10116
|
-
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
10117
|
-
}
|
|
10118
|
-
break;
|
|
10119
|
-
default:
|
|
10120
|
-
if (isCharacterComplement && mayContainStrings) {
|
|
10121
|
-
error(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start2, pos - start2);
|
|
10122
|
-
}
|
|
10123
|
-
expressionMayContainStrings = mayContainStrings;
|
|
10124
|
-
break;
|
|
10125
|
-
}
|
|
10126
|
-
while (pos < end2) {
|
|
10127
|
-
ch = text2.charCodeAt(pos);
|
|
10128
|
-
switch (ch) {
|
|
10129
|
-
case 45 /* minus */:
|
|
10130
|
-
pos++;
|
|
10131
|
-
ch = text2.charCodeAt(pos);
|
|
10132
|
-
if (isClassContentExit(ch)) {
|
|
10133
|
-
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
10134
|
-
return;
|
|
10135
|
-
}
|
|
10136
|
-
if (ch === 45 /* minus */) {
|
|
10137
|
-
pos++;
|
|
10138
|
-
error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
10139
|
-
start2 = pos - 2;
|
|
10140
|
-
oprand = text2.slice(start2, pos);
|
|
10141
|
-
continue;
|
|
10142
|
-
} else {
|
|
10143
|
-
if (!oprand) {
|
|
10144
|
-
error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start2, pos - 1 - start2);
|
|
10145
|
-
}
|
|
10146
|
-
const secondStart = pos;
|
|
10147
|
-
const secondOprand = scanClassSetOprand();
|
|
10148
|
-
if (isCharacterComplement && mayContainStrings) {
|
|
10149
|
-
error(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, secondStart, pos - secondStart);
|
|
10150
|
-
}
|
|
10151
|
-
expressionMayContainStrings || (expressionMayContainStrings = mayContainStrings);
|
|
10152
|
-
if (!secondOprand) {
|
|
10153
|
-
error(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, secondStart, pos - secondStart);
|
|
10154
|
-
break;
|
|
10155
|
-
}
|
|
10156
|
-
if (!oprand) {
|
|
10157
|
-
break;
|
|
10158
|
-
}
|
|
10159
|
-
const minCharacterValue = codePointAt(oprand, 0);
|
|
10160
|
-
const maxCharacterValue = codePointAt(secondOprand, 0);
|
|
10161
|
-
if (oprand.length === charSize(minCharacterValue) && secondOprand.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
|
|
10162
|
-
error(Diagnostics.Range_out_of_order_in_character_class, start2, pos - start2);
|
|
10163
|
-
}
|
|
10164
|
-
}
|
|
10165
|
-
break;
|
|
10166
|
-
case 38 /* ampersand */:
|
|
10167
|
-
start2 = pos;
|
|
10168
|
-
pos++;
|
|
10169
|
-
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
10170
|
-
pos++;
|
|
10171
|
-
error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
10172
|
-
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
10173
|
-
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
10174
|
-
pos++;
|
|
10175
|
-
}
|
|
10176
|
-
} else {
|
|
10177
|
-
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
|
|
10178
|
-
}
|
|
10179
|
-
oprand = text2.slice(start2, pos);
|
|
10180
|
-
continue;
|
|
10181
|
-
}
|
|
10182
|
-
if (isClassContentExit(text2.charCodeAt(pos))) {
|
|
10183
|
-
break;
|
|
10184
|
-
}
|
|
10185
|
-
start2 = pos;
|
|
10186
|
-
switch (text2.slice(pos, pos + 2)) {
|
|
10187
|
-
case "--":
|
|
10188
|
-
case "&&":
|
|
10189
|
-
error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2);
|
|
10190
|
-
pos += 2;
|
|
10191
|
-
oprand = text2.slice(start2, pos);
|
|
10192
|
-
break;
|
|
10193
|
-
default:
|
|
10194
|
-
oprand = scanClassSetOprand();
|
|
10195
|
-
break;
|
|
10196
|
-
}
|
|
10197
|
-
}
|
|
10198
|
-
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
10199
|
-
}
|
|
10200
|
-
function scanClassSetSubExpression(expressionType) {
|
|
10201
|
-
let expressionMayContainStrings = mayContainStrings;
|
|
10202
|
-
while (pos < end2) {
|
|
10203
|
-
let ch = text2.charCodeAt(pos);
|
|
10204
|
-
if (isClassContentExit(ch)) {
|
|
10205
|
-
break;
|
|
10206
|
-
}
|
|
10207
|
-
switch (ch) {
|
|
10208
|
-
case 45 /* minus */:
|
|
10209
|
-
pos++;
|
|
10210
|
-
if (text2.charCodeAt(pos) === 45 /* minus */) {
|
|
10211
|
-
pos++;
|
|
10212
|
-
if (expressionType !== 3 /* ClassSubtraction */) {
|
|
10213
|
-
error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
10214
|
-
}
|
|
10215
|
-
} else {
|
|
10216
|
-
error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 1, 1);
|
|
10217
|
-
}
|
|
10218
|
-
break;
|
|
10219
|
-
case 38 /* ampersand */:
|
|
10220
|
-
pos++;
|
|
10221
|
-
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
10222
|
-
pos++;
|
|
10223
|
-
if (expressionType !== 2 /* ClassIntersection */) {
|
|
10224
|
-
error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
10225
|
-
}
|
|
10226
|
-
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
10227
|
-
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
10228
|
-
pos++;
|
|
10229
|
-
}
|
|
10230
|
-
} else {
|
|
10231
|
-
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
|
|
10232
|
-
}
|
|
10233
|
-
break;
|
|
10234
|
-
default:
|
|
10235
|
-
switch (expressionType) {
|
|
10236
|
-
case 3 /* ClassSubtraction */:
|
|
10237
|
-
error(Diagnostics._0_expected, pos, 0, "--");
|
|
10238
|
-
break;
|
|
10239
|
-
case 2 /* ClassIntersection */:
|
|
10240
|
-
error(Diagnostics._0_expected, pos, 0, "&&");
|
|
10241
|
-
break;
|
|
10242
|
-
default:
|
|
10243
|
-
break;
|
|
10244
|
-
}
|
|
10245
|
-
break;
|
|
10246
|
-
}
|
|
10247
|
-
ch = text2.charCodeAt(pos);
|
|
10248
|
-
if (isClassContentExit(ch)) {
|
|
10249
|
-
error(Diagnostics.Expected_a_class_set_oprand);
|
|
10250
|
-
break;
|
|
10251
|
-
}
|
|
10252
|
-
scanClassSetOprand();
|
|
10253
|
-
expressionMayContainStrings && (expressionMayContainStrings = mayContainStrings);
|
|
10254
|
-
}
|
|
10255
|
-
mayContainStrings = expressionMayContainStrings;
|
|
10256
|
-
}
|
|
10257
|
-
function scanClassSetOprand() {
|
|
10258
|
-
mayContainStrings = false;
|
|
10259
|
-
switch (text2.charCodeAt(pos)) {
|
|
10260
|
-
case 91 /* openBracket */:
|
|
10261
|
-
pos++;
|
|
10262
|
-
scanClassSetExpression();
|
|
10263
|
-
scanExpectedChar(93 /* closeBracket */);
|
|
10264
|
-
return "";
|
|
10265
|
-
case 92 /* backslash */:
|
|
10266
|
-
pos++;
|
|
10267
|
-
if (scanCharacterClassEscape()) {
|
|
10268
|
-
return "";
|
|
10269
|
-
} else if (text2.charCodeAt(pos) === 113 /* q */) {
|
|
10270
|
-
pos++;
|
|
10271
|
-
if (text2.charCodeAt(pos) === 123 /* openBrace */) {
|
|
10272
|
-
pos++;
|
|
10273
|
-
scanClassStringDisjunctionContents();
|
|
10274
|
-
scanExpectedChar(125 /* closeBrace */);
|
|
10275
|
-
return "";
|
|
10276
|
-
} else {
|
|
10277
|
-
error(Diagnostics.q_must_be_followed_by_string_alternatives_enclosed_in_braces, pos - 2, 2);
|
|
10278
|
-
return "q";
|
|
10279
|
-
}
|
|
10280
|
-
}
|
|
10281
|
-
pos--;
|
|
10282
|
-
default:
|
|
10283
|
-
return scanClassSetCharacter();
|
|
10284
|
-
}
|
|
10285
|
-
}
|
|
10286
|
-
function scanClassStringDisjunctionContents() {
|
|
10287
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 123 /* openBrace */);
|
|
10288
|
-
let characterCount = 0;
|
|
10289
|
-
while (pos < end2) {
|
|
10290
|
-
const ch = text2.charCodeAt(pos);
|
|
10291
|
-
switch (ch) {
|
|
10292
|
-
case 125 /* closeBrace */:
|
|
10293
|
-
if (characterCount !== 1) {
|
|
10294
|
-
mayContainStrings = true;
|
|
10295
|
-
}
|
|
10296
|
-
return;
|
|
10297
|
-
case 124 /* bar */:
|
|
10298
|
-
if (characterCount !== 1) {
|
|
10299
|
-
mayContainStrings = true;
|
|
10300
|
-
}
|
|
10301
|
-
pos++;
|
|
10302
|
-
start = pos;
|
|
10303
|
-
characterCount = 0;
|
|
10304
|
-
break;
|
|
10305
|
-
default:
|
|
10306
|
-
scanClassSetCharacter();
|
|
10307
|
-
characterCount++;
|
|
10308
|
-
break;
|
|
10309
|
-
}
|
|
10310
|
-
}
|
|
10311
|
-
}
|
|
10312
|
-
function scanClassSetCharacter() {
|
|
10313
|
-
const ch = text2.charCodeAt(pos);
|
|
10314
|
-
if (ch === 92 /* backslash */) {
|
|
10315
|
-
pos++;
|
|
10316
|
-
const ch2 = text2.charCodeAt(pos);
|
|
10317
|
-
switch (ch2) {
|
|
10318
|
-
case 98 /* b */:
|
|
10319
|
-
pos++;
|
|
10320
|
-
return "\b";
|
|
10321
|
-
case 38 /* ampersand */:
|
|
10322
|
-
case 45 /* minus */:
|
|
10323
|
-
case 33 /* exclamation */:
|
|
10324
|
-
case 35 /* hash */:
|
|
10325
|
-
case 37 /* percent */:
|
|
10326
|
-
case 44 /* comma */:
|
|
10327
|
-
case 58 /* colon */:
|
|
10328
|
-
case 59 /* semicolon */:
|
|
10329
|
-
case 60 /* lessThan */:
|
|
10330
|
-
case 61 /* equals */:
|
|
10331
|
-
case 62 /* greaterThan */:
|
|
10332
|
-
case 64 /* at */:
|
|
10333
|
-
case 96 /* backtick */:
|
|
10334
|
-
case 126 /* tilde */:
|
|
10335
|
-
pos++;
|
|
10336
|
-
return String.fromCharCode(ch2);
|
|
10337
|
-
default:
|
|
10338
|
-
return scanCharacterEscape();
|
|
10339
|
-
}
|
|
10340
|
-
} else if (ch === text2.charCodeAt(pos + 1)) {
|
|
10341
|
-
switch (ch) {
|
|
10342
|
-
case 38 /* ampersand */:
|
|
10343
|
-
case 33 /* exclamation */:
|
|
10344
|
-
case 35 /* hash */:
|
|
10345
|
-
case 37 /* percent */:
|
|
10346
|
-
case 42 /* asterisk */:
|
|
10347
|
-
case 43 /* plus */:
|
|
10348
|
-
case 44 /* comma */:
|
|
10349
|
-
case 46 /* dot */:
|
|
10350
|
-
case 58 /* colon */:
|
|
10351
|
-
case 59 /* semicolon */:
|
|
10352
|
-
case 60 /* lessThan */:
|
|
10353
|
-
case 61 /* equals */:
|
|
10354
|
-
case 62 /* greaterThan */:
|
|
10355
|
-
case 63 /* question */:
|
|
10356
|
-
case 64 /* at */:
|
|
10357
|
-
case 96 /* backtick */:
|
|
10358
|
-
case 126 /* tilde */:
|
|
10359
|
-
error(Diagnostics.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, pos, 2);
|
|
10360
|
-
pos += 2;
|
|
10361
|
-
return text2.substring(pos - 2, pos);
|
|
10362
|
-
}
|
|
10363
|
-
}
|
|
10364
|
-
switch (ch) {
|
|
10365
|
-
case 47 /* slash */:
|
|
10366
|
-
case 40 /* openParen */:
|
|
10367
|
-
case 41 /* closeParen */:
|
|
10368
|
-
case 91 /* openBracket */:
|
|
10369
|
-
case 93 /* closeBracket */:
|
|
10370
|
-
case 123 /* openBrace */:
|
|
10371
|
-
case 125 /* closeBrace */:
|
|
10372
|
-
case 45 /* minus */:
|
|
10373
|
-
case 124 /* bar */:
|
|
10374
|
-
error(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
10375
|
-
pos++;
|
|
10376
|
-
return String.fromCharCode(ch);
|
|
10377
|
-
}
|
|
10378
|
-
return scanSourceCharacter();
|
|
10379
|
-
}
|
|
10380
|
-
function scanClassAtom() {
|
|
10381
|
-
if (text2.charCodeAt(pos) === 92 /* backslash */) {
|
|
10382
|
-
pos++;
|
|
10383
|
-
const ch = text2.charCodeAt(pos);
|
|
10384
|
-
switch (ch) {
|
|
10385
|
-
case 98 /* b */:
|
|
10386
|
-
pos++;
|
|
10387
|
-
return "\b";
|
|
10388
|
-
case 45 /* minus */:
|
|
10389
|
-
pos++;
|
|
10390
|
-
return String.fromCharCode(ch);
|
|
10391
|
-
default:
|
|
10392
|
-
if (scanCharacterClassEscape()) {
|
|
10393
|
-
return "";
|
|
10394
|
-
}
|
|
10395
|
-
return scanCharacterEscape();
|
|
10396
|
-
}
|
|
10397
|
-
} else {
|
|
10398
|
-
return scanSourceCharacter();
|
|
10399
|
-
}
|
|
10400
|
-
}
|
|
10401
|
-
function scanCharacterClassEscape() {
|
|
10402
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
10403
|
-
let isCharacterComplement = false;
|
|
10404
|
-
const start2 = pos - 1;
|
|
10405
|
-
const ch = text2.charCodeAt(pos);
|
|
10406
|
-
switch (ch) {
|
|
10407
|
-
case 100 /* d */:
|
|
10408
|
-
case 68 /* D */:
|
|
10409
|
-
case 115 /* s */:
|
|
10410
|
-
case 83 /* S */:
|
|
10411
|
-
case 119 /* w */:
|
|
10412
|
-
case 87 /* W */:
|
|
10413
|
-
pos++;
|
|
10414
|
-
return true;
|
|
10415
|
-
case 80 /* P */:
|
|
10416
|
-
isCharacterComplement = true;
|
|
10417
|
-
case 112 /* p */:
|
|
10418
|
-
pos++;
|
|
10419
|
-
if (text2.charCodeAt(pos) === 123 /* openBrace */) {
|
|
10420
|
-
pos++;
|
|
10421
|
-
const propertyNameOrValueStart = pos;
|
|
10422
|
-
const propertyNameOrValue = scanWordCharacters();
|
|
10423
|
-
if (text2.charCodeAt(pos) === 61 /* equals */) {
|
|
10424
|
-
const propertyName = nonBinaryUnicodeProperties.get(propertyNameOrValue);
|
|
10425
|
-
if (pos === propertyNameOrValueStart) {
|
|
10426
|
-
error(Diagnostics.Expected_a_Unicode_property_name);
|
|
10427
|
-
} else if (propertyName === void 0) {
|
|
10428
|
-
error(Diagnostics.Unknown_Unicode_property_name, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
10429
|
-
const suggestion = getSpellingSuggestion(propertyNameOrValue, nonBinaryUnicodeProperties.keys(), identity);
|
|
10430
|
-
if (suggestion) {
|
|
10431
|
-
error(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
|
|
10432
|
-
}
|
|
10433
|
-
}
|
|
10434
|
-
pos++;
|
|
10435
|
-
const propertyValueStart = pos;
|
|
10436
|
-
const propertyValue = scanWordCharacters();
|
|
10437
|
-
if (pos === propertyValueStart) {
|
|
10438
|
-
error(Diagnostics.Expected_a_Unicode_property_value);
|
|
10439
|
-
} else if (propertyName !== void 0 && !valuesOfNonBinaryUnicodeProperties[propertyName].has(propertyValue)) {
|
|
10440
|
-
error(Diagnostics.Unknown_Unicode_property_value, propertyValueStart, pos - propertyValueStart);
|
|
10441
|
-
const suggestion = getSpellingSuggestion(propertyValue, valuesOfNonBinaryUnicodeProperties[propertyName], identity);
|
|
10442
|
-
if (suggestion) {
|
|
10443
|
-
error(Diagnostics.Did_you_mean_0, propertyValueStart, pos - propertyValueStart, suggestion);
|
|
10444
|
-
}
|
|
10445
|
-
}
|
|
10446
|
-
} else {
|
|
10447
|
-
if (pos === propertyNameOrValueStart) {
|
|
10448
|
-
error(Diagnostics.Expected_a_Unicode_property_name_or_value);
|
|
10449
|
-
} else if (binaryUnicodePropertiesOfStrings.has(propertyNameOrValue)) {
|
|
10450
|
-
if (!unicodeSetsMode) {
|
|
10451
|
-
error(Diagnostics.Any_Unicode_property_that_would_possibly_match_more_than_a_single_character_is_only_available_when_the_Unicode_Sets_v_flag_is_set, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
10452
|
-
} else if (isCharacterComplement) {
|
|
10453
|
-
error(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
10454
|
-
} else {
|
|
10455
|
-
mayContainStrings = true;
|
|
10456
|
-
}
|
|
10457
|
-
} else if (!valuesOfNonBinaryUnicodeProperties.General_Category.has(propertyNameOrValue) && !binaryUnicodeProperties.has(propertyNameOrValue)) {
|
|
10458
|
-
error(Diagnostics.Unknown_Unicode_property_name_or_value, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
10459
|
-
const suggestion = getSpellingSuggestion(propertyNameOrValue, [...valuesOfNonBinaryUnicodeProperties.General_Category, ...binaryUnicodeProperties, ...binaryUnicodePropertiesOfStrings], identity);
|
|
10460
|
-
if (suggestion) {
|
|
10461
|
-
error(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
|
|
10462
|
-
}
|
|
10463
|
-
}
|
|
10464
|
-
}
|
|
10465
|
-
scanExpectedChar(125 /* closeBrace */);
|
|
10466
|
-
if (!unicodeMode) {
|
|
10467
|
-
error(Diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start2, pos - start2);
|
|
10468
|
-
}
|
|
10469
|
-
} else if (unicodeMode) {
|
|
10470
|
-
error(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch));
|
|
10471
|
-
}
|
|
10472
|
-
return true;
|
|
10473
|
-
}
|
|
10474
|
-
return false;
|
|
10475
|
-
}
|
|
10476
|
-
function scanWordCharacters() {
|
|
10477
|
-
let value = "";
|
|
10478
|
-
while (pos < end2) {
|
|
10479
|
-
const ch = text2.charCodeAt(pos);
|
|
10480
|
-
if (!isWordCharacter(ch)) {
|
|
10481
|
-
break;
|
|
10482
|
-
}
|
|
10483
|
-
value += String.fromCharCode(ch);
|
|
10484
|
-
pos++;
|
|
10485
|
-
}
|
|
10486
|
-
return value;
|
|
10487
|
-
}
|
|
10488
|
-
function scanSourceCharacter() {
|
|
10489
|
-
const size = unicodeMode ? charSize(codePointAt(text2, pos)) : 1;
|
|
10490
|
-
pos += size;
|
|
10491
|
-
return text2.substring(pos - size, pos);
|
|
10492
|
-
}
|
|
10493
|
-
function scanExpectedChar(ch) {
|
|
10494
|
-
if (text2.charCodeAt(pos) === ch) {
|
|
10495
|
-
pos++;
|
|
10496
|
-
} else {
|
|
10497
|
-
error(Diagnostics._0_expected, pos, 0, String.fromCharCode(ch));
|
|
10498
|
-
}
|
|
10499
|
-
}
|
|
10500
|
-
scanDisjunction(
|
|
10501
|
-
/*isInGroup*/
|
|
10502
|
-
false
|
|
10503
|
-
);
|
|
10504
|
-
forEach(groupNameReferences, (reference) => {
|
|
10505
|
-
if (!groupSpecifiers.has(reference.name)) {
|
|
10506
|
-
error(Diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end - reference.pos, reference.name);
|
|
10507
|
-
}
|
|
10508
|
-
});
|
|
10509
|
-
forEach(decimalEscapes, (escape) => {
|
|
10510
|
-
if (escape.value > numberOfCapturingGroups) {
|
|
10511
|
-
if (numberOfCapturingGroups) {
|
|
10512
|
-
error(Diagnostics.A_decimal_escape_must_refer_to_an_existent_capturing_group_There_are_only_0_capturing_groups_in_this_regular_expression, escape.pos, escape.end - escape.pos, numberOfCapturingGroups);
|
|
10513
|
-
} else {
|
|
10514
|
-
error(Diagnostics.Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression, escape.pos, escape.end - escape.pos);
|
|
10515
|
-
}
|
|
10516
|
-
}
|
|
10517
|
-
});
|
|
10518
|
-
}
|
|
10519
9629
|
}
|
|
10520
9630
|
function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
|
|
10521
9631
|
const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx);
|
|
@@ -10738,6 +9848,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
10738
9848
|
pos--;
|
|
10739
9849
|
const extendedCookedChar = peekExtendedUnicodeEscape();
|
|
10740
9850
|
if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
|
|
9851
|
+
pos += 3;
|
|
9852
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
10741
9853
|
tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
10742
9854
|
return token = getIdentifierToken();
|
|
10743
9855
|
}
|
|
@@ -10837,8 +9949,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
10837
9949
|
function setLanguageVariant(variant) {
|
|
10838
9950
|
languageVariant = variant;
|
|
10839
9951
|
}
|
|
10840
|
-
function
|
|
10841
|
-
|
|
9952
|
+
function setScriptKind(kind) {
|
|
9953
|
+
scriptKind = kind;
|
|
9954
|
+
}
|
|
9955
|
+
function setJSDocParsingMode(kind) {
|
|
9956
|
+
jsDocParsingMode = kind;
|
|
10842
9957
|
}
|
|
10843
9958
|
function resetTokenState(position) {
|
|
10844
9959
|
Debug.assert(position >= 0);
|
|
@@ -10875,22 +9990,6 @@ var utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fro
|
|
|
10875
9990
|
function utf16EncodeAsString(codePoint) {
|
|
10876
9991
|
return utf16EncodeAsStringWorker(codePoint);
|
|
10877
9992
|
}
|
|
10878
|
-
var nonBinaryUnicodeProperties = new Map(Object.entries({
|
|
10879
|
-
General_Category: "General_Category",
|
|
10880
|
-
gc: "General_Category",
|
|
10881
|
-
Script: "Script",
|
|
10882
|
-
sc: "Script",
|
|
10883
|
-
Script_Extensions: "Script_Extensions",
|
|
10884
|
-
scx: "Script_Extensions"
|
|
10885
|
-
}));
|
|
10886
|
-
var binaryUnicodeProperties = /* @__PURE__ */ new Set(["ASCII", "ASCII_Hex_Digit", "AHex", "Alphabetic", "Alpha", "Any", "Assigned", "Bidi_Control", "Bidi_C", "Bidi_Mirrored", "Bidi_M", "Case_Ignorable", "CI", "Cased", "Changes_When_Casefolded", "CWCF", "Changes_When_Casemapped", "CWCM", "Changes_When_Lowercased", "CWL", "Changes_When_NFKC_Casefolded", "CWKCF", "Changes_When_Titlecased", "CWT", "Changes_When_Uppercased", "CWU", "Dash", "Default_Ignorable_Code_Point", "DI", "Deprecated", "Dep", "Diacritic", "Dia", "Emoji", "Emoji_Component", "EComp", "Emoji_Modifier", "EMod", "Emoji_Modifier_Base", "EBase", "Emoji_Presentation", "EPres", "Extended_Pictographic", "ExtPict", "Extender", "Ext", "Grapheme_Base", "Gr_Base", "Grapheme_Extend", "Gr_Ext", "Hex_Digit", "Hex", "IDS_Binary_Operator", "IDSB", "IDS_Trinary_Operator", "IDST", "ID_Continue", "IDC", "ID_Start", "IDS", "Ideographic", "Ideo", "Join_Control", "Join_C", "Logical_Order_Exception", "LOE", "Lowercase", "Lower", "Math", "Noncharacter_Code_Point", "NChar", "Pattern_Syntax", "Pat_Syn", "Pattern_White_Space", "Pat_WS", "Quotation_Mark", "QMark", "Radical", "Regional_Indicator", "RI", "Sentence_Terminal", "STerm", "Soft_Dotted", "SD", "Terminal_Punctuation", "Term", "Unified_Ideograph", "UIdeo", "Uppercase", "Upper", "Variation_Selector", "VS", "White_Space", "space", "XID_Continue", "XIDC", "XID_Start", "XIDS"]);
|
|
10887
|
-
var binaryUnicodePropertiesOfStrings = /* @__PURE__ */ new Set(["Basic_Emoji", "Emoji_Keycap_Sequence", "RGI_Emoji_Modifier_Sequence", "RGI_Emoji_Flag_Sequence", "RGI_Emoji_Tag_Sequence", "RGI_Emoji_ZWJ_Sequence", "RGI_Emoji"]);
|
|
10888
|
-
var valuesOfNonBinaryUnicodeProperties = {
|
|
10889
|
-
General_Category: /* @__PURE__ */ new Set(["C", "Other", "Cc", "Control", "cntrl", "Cf", "Format", "Cn", "Unassigned", "Co", "Private_Use", "Cs", "Surrogate", "L", "Letter", "LC", "Cased_Letter", "Ll", "Lowercase_Letter", "Lm", "Modifier_Letter", "Lo", "Other_Letter", "Lt", "Titlecase_Letter", "Lu", "Uppercase_Letter", "M", "Mark", "Combining_Mark", "Mc", "Spacing_Mark", "Me", "Enclosing_Mark", "Mn", "Nonspacing_Mark", "N", "Number", "Nd", "Decimal_Number", "digit", "Nl", "Letter_Number", "No", "Other_Number", "P", "Punctuation", "punct", "Pc", "Connector_Punctuation", "Pd", "Dash_Punctuation", "Pe", "Close_Punctuation", "Pf", "Final_Punctuation", "Pi", "Initial_Punctuation", "Po", "Other_Punctuation", "Ps", "Open_Punctuation", "S", "Symbol", "Sc", "Currency_Symbol", "Sk", "Modifier_Symbol", "Sm", "Math_Symbol", "So", "Other_Symbol", "Z", "Separator", "Zl", "Line_Separator", "Zp", "Paragraph_Separator", "Zs", "Space_Separator"]),
|
|
10890
|
-
Script: /* @__PURE__ */ new Set(["Adlm", "Adlam", "Aghb", "Caucasian_Albanian", "Ahom", "Ahom", "Arab", "Arabic", "Armi", "Imperial_Aramaic", "Armn", "Armenian", "Avst", "Avestan", "Bali", "Balinese", "Bamu", "Bamum", "Bass", "Bassa_Vah", "Batk", "Batak", "Beng", "Bengali", "Bhks", "Bhaiksuki", "Bopo", "Bopomofo", "Brah", "Brahmi", "Brai", "Braille", "Bugi", "Buginese", "Buhd", "Buhid", "Cakm", "Chakma", "Cans", "Canadian_Aboriginal", "Cari", "Carian", "Cham", "Cham", "Cher", "Cherokee", "Chrs", "Chorasmian", "Copt", "Coptic", "Qaac", "Cpmn", "Cypro_Minoan", "Cprt", "Cypriot", "Cyrl", "Cyrillic", "Deva", "Devanagari", "Diak", "Dives_Akuru", "Dogr", "Dogra", "Dsrt", "Deseret", "Dupl", "Duployan", "Egyp", "Egyptian_Hieroglyphs", "Elba", "Elbasan", "Elym", "Elymaic", "Ethi", "Ethiopic", "Geor", "Georgian", "Glag", "Glagolitic", "Gong", "Gunjala_Gondi", "Gonm", "Masaram_Gondi", "Goth", "Gothic", "Gran", "Grantha", "Grek", "Greek", "Gujr", "Gujarati", "Guru", "Gurmukhi", "Hang", "Hangul", "Hani", "Han", "Hano", "Hanunoo", "Hatr", "Hatran", "Hebr", "Hebrew", "Hira", "Hiragana", "Hluw", "Anatolian_Hieroglyphs", "Hmng", "Pahawh_Hmong", "Hmnp", "Nyiakeng_Puachue_Hmong", "Hrkt", "Katakana_Or_Hiragana", "Hung", "Old_Hungarian", "Ital", "Old_Italic", "Java", "Javanese", "Kali", "Kayah_Li", "Kana", "Katakana", "Kawi", "Kawi", "Khar", "Kharoshthi", "Khmr", "Khmer", "Khoj", "Khojki", "Kits", "Khitan_Small_Script", "Knda", "Kannada", "Kthi", "Kaithi", "Lana", "Tai_Tham", "Laoo", "Lao", "Latn", "Latin", "Lepc", "Lepcha", "Limb", "Limbu", "Lina", "Linear_A", "Linb", "Linear_B", "Lisu", "Lisu", "Lyci", "Lycian", "Lydi", "Lydian", "Mahj", "Mahajani", "Maka", "Makasar", "Mand", "Mandaic", "Mani", "Manichaean", "Marc", "Marchen", "Medf", "Medefaidrin", "Mend", "Mende_Kikakui", "Merc", "Meroitic_Cursive", "Mero", "Meroitic_Hieroglyphs", "Mlym", "Malayalam", "Modi", "Modi", "Mong", "Mongolian", "Mroo", "Mro", "Mtei", "Meetei_Mayek", "Mult", "Multani", "Mymr", "Myanmar", "Nagm", "Nag_Mundari", "Nand", "Nandinagari", "Narb", "Old_North_Arabian", "Nbat", "Nabataean", "Newa", "Newa", "Nkoo", "Nko", "Nshu", "Nushu", "Ogam", "Ogham", "Olck", "Ol_Chiki", "Orkh", "Old_Turkic", "Orya", "Oriya", "Osge", "Osage", "Osma", "Osmanya", "Ougr", "Old_Uyghur", "Palm", "Palmyrene", "Pauc", "Pau_Cin_Hau", "Perm", "Old_Permic", "Phag", "Phags_Pa", "Phli", "Inscriptional_Pahlavi", "Phlp", "Psalter_Pahlavi", "Phnx", "Phoenician", "Plrd", "Miao", "Prti", "Inscriptional_Parthian", "Rjng", "Rejang", "Rohg", "Hanifi_Rohingya", "Runr", "Runic", "Samr", "Samaritan", "Sarb", "Old_South_Arabian", "Saur", "Saurashtra", "Sgnw", "SignWriting", "Shaw", "Shavian", "Shrd", "Sharada", "Sidd", "Siddham", "Sind", "Khudawadi", "Sinh", "Sinhala", "Sogd", "Sogdian", "Sogo", "Old_Sogdian", "Sora", "Sora_Sompeng", "Soyo", "Soyombo", "Sund", "Sundanese", "Sylo", "Syloti_Nagri", "Syrc", "Syriac", "Tagb", "Tagbanwa", "Takr", "Takri", "Tale", "Tai_Le", "Talu", "New_Tai_Lue", "Taml", "Tamil", "Tang", "Tangut", "Tavt", "Tai_Viet", "Telu", "Telugu", "Tfng", "Tifinagh", "Tglg", "Tagalog", "Thaa", "Thaana", "Thai", "Thai", "Tibt", "Tibetan", "Tirh", "Tirhuta", "Tnsa", "Tangsa", "Toto", "Toto", "Ugar", "Ugaritic", "Vaii", "Vai", "Vith", "Vithkuqi", "Wara", "Warang_Citi", "Wcho", "Wancho", "Xpeo", "Old_Persian", "Xsux", "Cuneiform", "Yezi", "Yezidi", "Yiii", "Yi", "Zanb", "Zanabazar_Square", "Zinh", "Inherited", "Qaai", "Zyyy", "Common", "Zzzz", "Unknown"]),
|
|
10891
|
-
Script_Extensions: /* @__PURE__ */ new Set()
|
|
10892
|
-
// Currently empty
|
|
10893
|
-
};
|
|
10894
9993
|
|
|
10895
9994
|
// src/compiler/utilitiesPublic.ts
|
|
10896
9995
|
function isExternalModuleNameRelative(moduleName) {
|
|
@@ -11707,6 +10806,9 @@ function isAccessor(node) {
|
|
|
11707
10806
|
function isAutoAccessorPropertyDeclaration(node) {
|
|
11708
10807
|
return isPropertyDeclaration(node) && hasAccessorModifier(node);
|
|
11709
10808
|
}
|
|
10809
|
+
function isClassFieldAndNotAutoAccessor(node) {
|
|
10810
|
+
return node.parent && isClassLike(node.parent) && isPropertyDeclaration(node) && !hasAccessorModifier(node);
|
|
10811
|
+
}
|
|
11710
10812
|
function isMethodOrAccessor(node) {
|
|
11711
10813
|
switch (node.kind) {
|
|
11712
10814
|
case 174 /* MethodDeclaration */:
|
|
@@ -12360,8 +11462,8 @@ function moduleResolutionIsEqualTo(oldResolution, newResolution) {
|
|
|
12360
11462
|
return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.node10Result === newResolution.node10Result;
|
|
12361
11463
|
}
|
|
12362
11464
|
function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
|
|
12363
|
-
var _a
|
|
12364
|
-
const node10Result = (
|
|
11465
|
+
var _a;
|
|
11466
|
+
const node10Result = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.node10Result;
|
|
12365
11467
|
const result = node10Result ? chainDiagnosticMessages(
|
|
12366
11468
|
/*details*/
|
|
12367
11469
|
void 0,
|
|
@@ -12403,14 +11505,14 @@ function packageIdToString(packageId) {
|
|
|
12403
11505
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
12404
11506
|
return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
|
|
12405
11507
|
}
|
|
12406
|
-
function hasChangesInResolutions(names, newSourceFile, newResolutions,
|
|
11508
|
+
function hasChangesInResolutions(names, newSourceFile, newResolutions, getOldResolution, comparer, nameAndModeGetter) {
|
|
12407
11509
|
Debug.assert(names.length === newResolutions.length);
|
|
12408
11510
|
for (let i = 0; i < names.length; i++) {
|
|
12409
11511
|
const newResolution = newResolutions[i];
|
|
12410
11512
|
const entry = names[i];
|
|
12411
11513
|
const name = nameAndModeGetter.getName(entry);
|
|
12412
11514
|
const mode = nameAndModeGetter.getMode(entry, newSourceFile);
|
|
12413
|
-
const oldResolution =
|
|
11515
|
+
const oldResolution = getOldResolution(name, mode);
|
|
12414
11516
|
const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution;
|
|
12415
11517
|
if (changed) {
|
|
12416
11518
|
return true;
|
|
@@ -17376,11 +16478,11 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
|
|
|
17376
16478
|
(symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
|
|
17377
16479
|
}
|
|
17378
16480
|
},
|
|
17379
|
-
setSymlinksFromResolutions(
|
|
16481
|
+
setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, typeReferenceDirectives) {
|
|
17380
16482
|
Debug.assert(!hasProcessedResolutions);
|
|
17381
16483
|
hasProcessedResolutions = true;
|
|
17382
|
-
|
|
17383
|
-
|
|
16484
|
+
forEachResolvedModule((resolution) => processResolution(this, resolution.resolvedModule));
|
|
16485
|
+
forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
17384
16486
|
typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
17385
16487
|
},
|
|
17386
16488
|
hasProcessedResolutions: () => hasProcessedResolutions
|
|
@@ -27191,7 +26293,7 @@ function gatherPossibleChildren(node) {
|
|
|
27191
26293
|
function setExternalModuleIndicator(sourceFile) {
|
|
27192
26294
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
27193
26295
|
}
|
|
27194
|
-
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind
|
|
26296
|
+
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
27195
26297
|
var _a, _b, _c, _d;
|
|
27196
26298
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
27197
26299
|
tracing.Phase.Parse,
|
|
@@ -27206,7 +26308,8 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
27206
26308
|
const {
|
|
27207
26309
|
languageVersion,
|
|
27208
26310
|
setExternalModuleIndicator: overrideSetExternalModuleIndicator,
|
|
27209
|
-
impliedNodeFormat: format
|
|
26311
|
+
impliedNodeFormat: format,
|
|
26312
|
+
jsDocParsingMode
|
|
27210
26313
|
} = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions };
|
|
27211
26314
|
if (languageVersion === 100 /* JSON */) {
|
|
27212
26315
|
result = Parser.parseSourceFile(
|
|
@@ -27218,7 +26321,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
27218
26321
|
setParentNodes,
|
|
27219
26322
|
6 /* JSON */,
|
|
27220
26323
|
noop,
|
|
27221
|
-
|
|
26324
|
+
jsDocParsingMode
|
|
27222
26325
|
);
|
|
27223
26326
|
} else {
|
|
27224
26327
|
const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
|
|
@@ -27234,7 +26337,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
27234
26337
|
setParentNodes,
|
|
27235
26338
|
scriptKind,
|
|
27236
26339
|
setIndicator,
|
|
27237
|
-
|
|
26340
|
+
jsDocParsingMode
|
|
27238
26341
|
);
|
|
27239
26342
|
}
|
|
27240
26343
|
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
@@ -27353,7 +26456,7 @@ var Parser;
|
|
|
27353
26456
|
var contextFlags;
|
|
27354
26457
|
var topLevel = true;
|
|
27355
26458
|
var parseErrorBeforeNextFinishedNode = false;
|
|
27356
|
-
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride,
|
|
26459
|
+
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) {
|
|
27357
26460
|
var _a;
|
|
27358
26461
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
27359
26462
|
if (scriptKind2 === 6 /* JSON */) {
|
|
@@ -27375,9 +26478,8 @@ var Parser;
|
|
|
27375
26478
|
result2.pragmas = emptyMap;
|
|
27376
26479
|
return result2;
|
|
27377
26480
|
}
|
|
27378
|
-
|
|
27379
|
-
|
|
27380
|
-
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
|
|
26481
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
|
|
26482
|
+
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
|
|
27381
26483
|
clearState();
|
|
27382
26484
|
return result;
|
|
27383
26485
|
}
|
|
@@ -27390,8 +26492,7 @@ var Parser;
|
|
|
27390
26492
|
/*syntaxCursor*/
|
|
27391
26493
|
void 0,
|
|
27392
26494
|
1 /* JS */,
|
|
27393
|
-
/*
|
|
27394
|
-
false
|
|
26495
|
+
0 /* ParseAll */
|
|
27395
26496
|
);
|
|
27396
26497
|
nextToken();
|
|
27397
26498
|
const entityName = parseEntityName(
|
|
@@ -27404,15 +26505,7 @@ var Parser;
|
|
|
27404
26505
|
}
|
|
27405
26506
|
Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
|
|
27406
26507
|
function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
|
|
27407
|
-
initializeState(
|
|
27408
|
-
fileName2,
|
|
27409
|
-
sourceText2,
|
|
27410
|
-
languageVersion2,
|
|
27411
|
-
syntaxCursor2,
|
|
27412
|
-
6 /* JSON */,
|
|
27413
|
-
/*skipNonSemanticJSDoc*/
|
|
27414
|
-
false
|
|
27415
|
-
);
|
|
26508
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */);
|
|
27416
26509
|
sourceFlags = contextFlags;
|
|
27417
26510
|
nextToken();
|
|
27418
26511
|
const pos = getNodePos();
|
|
@@ -27493,7 +26586,7 @@ var Parser;
|
|
|
27493
26586
|
return result;
|
|
27494
26587
|
}
|
|
27495
26588
|
Parser2.parseJsonText = parseJsonText2;
|
|
27496
|
-
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind,
|
|
26589
|
+
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
|
|
27497
26590
|
NodeConstructor2 = objectAllocator.getNodeConstructor();
|
|
27498
26591
|
TokenConstructor2 = objectAllocator.getTokenConstructor();
|
|
27499
26592
|
IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
|
|
@@ -27529,13 +26622,15 @@ var Parser;
|
|
|
27529
26622
|
scanner.setOnError(scanError);
|
|
27530
26623
|
scanner.setScriptTarget(languageVersion);
|
|
27531
26624
|
scanner.setLanguageVariant(languageVariant);
|
|
27532
|
-
scanner.
|
|
26625
|
+
scanner.setScriptKind(scriptKind);
|
|
26626
|
+
scanner.setJSDocParsingMode(_jsDocParsingMode);
|
|
27533
26627
|
}
|
|
27534
26628
|
function clearState() {
|
|
27535
26629
|
scanner.clearCommentDirectives();
|
|
27536
26630
|
scanner.setText("");
|
|
27537
26631
|
scanner.setOnError(void 0);
|
|
27538
|
-
scanner.
|
|
26632
|
+
scanner.setScriptKind(0 /* Unknown */);
|
|
26633
|
+
scanner.setJSDocParsingMode(0 /* ParseAll */);
|
|
27539
26634
|
sourceText = void 0;
|
|
27540
26635
|
languageVersion = void 0;
|
|
27541
26636
|
syntaxCursor = void 0;
|
|
@@ -27549,7 +26644,7 @@ var Parser;
|
|
|
27549
26644
|
notParenthesizedArrow = void 0;
|
|
27550
26645
|
topLevel = true;
|
|
27551
26646
|
}
|
|
27552
|
-
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2,
|
|
26647
|
+
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
|
|
27553
26648
|
const isDeclarationFile = isDeclarationFileName(fileName);
|
|
27554
26649
|
if (isDeclarationFile) {
|
|
27555
26650
|
contextFlags |= 33554432 /* Ambient */;
|
|
@@ -27568,7 +26663,7 @@ var Parser;
|
|
|
27568
26663
|
sourceFile.identifierCount = identifierCount;
|
|
27569
26664
|
sourceFile.identifiers = identifiers;
|
|
27570
26665
|
sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
27571
|
-
sourceFile.
|
|
26666
|
+
sourceFile.jsDocParsingMode = jsDocParsingMode;
|
|
27572
26667
|
if (jsDocDiagnostics) {
|
|
27573
26668
|
sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
|
|
27574
26669
|
}
|
|
@@ -27816,10 +26911,7 @@ var Parser;
|
|
|
27816
26911
|
function parseErrorAtPosition(start, length2, message, ...args) {
|
|
27817
26912
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
27818
26913
|
let result;
|
|
27819
|
-
if (
|
|
27820
|
-
result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
|
|
27821
|
-
addRelatedInfo(lastError, result);
|
|
27822
|
-
} else if (!lastError || start !== lastError.start) {
|
|
26914
|
+
if (!lastError || start !== lastError.start) {
|
|
27823
26915
|
result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
|
|
27824
26916
|
parseDiagnostics.push(result);
|
|
27825
26917
|
}
|
|
@@ -27975,7 +27067,7 @@ var Parser;
|
|
|
27975
27067
|
parseErrorForInvalidName(Diagnostics.Type_alias_name_cannot_be_0, Diagnostics.Type_alias_must_be_given_a_name, 64 /* EqualsToken */);
|
|
27976
27068
|
return;
|
|
27977
27069
|
}
|
|
27978
|
-
const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions,
|
|
27070
|
+
const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, (n) => n) ?? getSpaceSuggestion(expressionText);
|
|
27979
27071
|
if (suggestion) {
|
|
27980
27072
|
parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion);
|
|
27981
27073
|
return;
|
|
@@ -33006,8 +32098,7 @@ var Parser;
|
|
|
33006
32098
|
/*syntaxCursor*/
|
|
33007
32099
|
void 0,
|
|
33008
32100
|
1 /* JS */,
|
|
33009
|
-
/*
|
|
33010
|
-
false
|
|
32101
|
+
0 /* ParseAll */
|
|
33011
32102
|
);
|
|
33012
32103
|
scanner.setText(content, start, length2);
|
|
33013
32104
|
currentToken = scanner.scan();
|
|
@@ -33072,8 +32163,7 @@ var Parser;
|
|
|
33072
32163
|
/*syntaxCursor*/
|
|
33073
32164
|
void 0,
|
|
33074
32165
|
1 /* JS */,
|
|
33075
|
-
/*
|
|
33076
|
-
false
|
|
32166
|
+
0 /* ParseAll */
|
|
33077
32167
|
);
|
|
33078
32168
|
const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2));
|
|
33079
32169
|
const sourceFile = { languageVariant: 0 /* Standard */, text: content };
|
|
@@ -34030,7 +33120,7 @@ var IncrementalParser;
|
|
|
34030
33120
|
true,
|
|
34031
33121
|
sourceFile.scriptKind,
|
|
34032
33122
|
sourceFile.setExternalModuleIndicator,
|
|
34033
|
-
sourceFile.
|
|
33123
|
+
sourceFile.jsDocParsingMode
|
|
34034
33124
|
);
|
|
34035
33125
|
}
|
|
34036
33126
|
const incrementalSourceFile = sourceFile;
|
|
@@ -34055,7 +33145,7 @@ var IncrementalParser;
|
|
|
34055
33145
|
true,
|
|
34056
33146
|
sourceFile.scriptKind,
|
|
34057
33147
|
sourceFile.setExternalModuleIndicator,
|
|
34058
|
-
sourceFile.
|
|
33148
|
+
sourceFile.jsDocParsingMode
|
|
34059
33149
|
);
|
|
34060
33150
|
result.commentDirectives = getNewCommentDirectives(
|
|
34061
33151
|
sourceFile.commentDirectives,
|
|
@@ -47212,7 +46302,7 @@ function createTypeChecker(host) {
|
|
|
47212
46302
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
47213
46303
|
}
|
|
47214
46304
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
47215
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k
|
|
46305
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
47216
46306
|
if (startsWith(moduleReference, "@types/")) {
|
|
47217
46307
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
47218
46308
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -47230,7 +46320,7 @@ function createTypeChecker(host) {
|
|
|
47230
46320
|
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
|
|
47231
46321
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
47232
46322
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
47233
|
-
const resolvedModule = (
|
|
46323
|
+
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
47234
46324
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
47235
46325
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
47236
46326
|
if (sourceFile) {
|
|
@@ -47238,7 +46328,7 @@ function createTypeChecker(host) {
|
|
|
47238
46328
|
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
47239
46329
|
}
|
|
47240
46330
|
if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
|
|
47241
|
-
const importOrExport = ((
|
|
46331
|
+
const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
47242
46332
|
if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
|
|
47243
46333
|
error(
|
|
47244
46334
|
errorNode,
|
|
@@ -47247,7 +46337,7 @@ function createTypeChecker(host) {
|
|
|
47247
46337
|
);
|
|
47248
46338
|
}
|
|
47249
46339
|
} else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
|
|
47250
|
-
const importOrExport = ((
|
|
46340
|
+
const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
47251
46341
|
if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
|
|
47252
46342
|
const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
|
|
47253
46343
|
error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
|
|
@@ -47268,7 +46358,7 @@ function createTypeChecker(host) {
|
|
|
47268
46358
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
47269
46359
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
47270
46360
|
const overrideClauseHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
47271
|
-
const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (
|
|
46361
|
+
const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_j = overrideClauseHost.assertions) == null ? void 0 : _j.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause;
|
|
47272
46362
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
47273
46363
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
47274
46364
|
error(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
|
|
@@ -47375,7 +46465,7 @@ function createTypeChecker(host) {
|
|
|
47375
46465
|
error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
47376
46466
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
47377
46467
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
47378
|
-
const suggestedExt = (
|
|
46468
|
+
const suggestedExt = (_k = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _k[1];
|
|
47379
46469
|
if (suggestedExt) {
|
|
47380
46470
|
error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
47381
46471
|
} else {
|
|
@@ -54133,7 +53223,28 @@ function createTypeChecker(host) {
|
|
|
54133
53223
|
}
|
|
54134
53224
|
}
|
|
54135
53225
|
}
|
|
54136
|
-
|
|
53226
|
+
let resolved = combineSymbolTables(earlySymbols, lateSymbols);
|
|
53227
|
+
if (symbol.flags & 33554432 /* Transient */ && links.cjsExportMerged && symbol.declarations) {
|
|
53228
|
+
for (const decl of symbol.declarations) {
|
|
53229
|
+
const original = getSymbolLinks(decl.symbol)[resolutionKind];
|
|
53230
|
+
if (!resolved) {
|
|
53231
|
+
resolved = original;
|
|
53232
|
+
continue;
|
|
53233
|
+
}
|
|
53234
|
+
if (!original)
|
|
53235
|
+
continue;
|
|
53236
|
+
original.forEach((s, name) => {
|
|
53237
|
+
const existing = resolved.get(name);
|
|
53238
|
+
if (!existing)
|
|
53239
|
+
resolved.set(name, s);
|
|
53240
|
+
else if (existing === s)
|
|
53241
|
+
return;
|
|
53242
|
+
else
|
|
53243
|
+
resolved.set(name, mergeSymbol(existing, s));
|
|
53244
|
+
});
|
|
53245
|
+
}
|
|
53246
|
+
}
|
|
53247
|
+
links[resolutionKind] = resolved || emptySymbols;
|
|
54137
53248
|
}
|
|
54138
53249
|
return links[resolutionKind];
|
|
54139
53250
|
}
|
|
@@ -62935,7 +62046,7 @@ function createTypeChecker(host) {
|
|
|
62935
62046
|
sourceSignatures[i],
|
|
62936
62047
|
targetSignatures[i],
|
|
62937
62048
|
/*erase*/
|
|
62938
|
-
|
|
62049
|
+
!inVarianceComputation,
|
|
62939
62050
|
reportErrors2,
|
|
62940
62051
|
intersectionState,
|
|
62941
62052
|
incompatibleReporter(sourceSignatures[i], targetSignatures[i])
|
|
@@ -70028,6 +69139,7 @@ function createTypeChecker(host) {
|
|
|
70028
69139
|
return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
|
|
70029
69140
|
}
|
|
70030
69141
|
function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
|
|
69142
|
+
var _a;
|
|
70031
69143
|
const flags = getDeclarationModifierFlagsFromSymbol(prop, writing);
|
|
70032
69144
|
if (isSuper) {
|
|
70033
69145
|
if (languageVersion < 2 /* ES2015 */) {
|
|
@@ -70044,6 +69156,12 @@ function createTypeChecker(host) {
|
|
|
70044
69156
|
}
|
|
70045
69157
|
return false;
|
|
70046
69158
|
}
|
|
69159
|
+
if (!(flags & 32 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassFieldAndNotAutoAccessor))) {
|
|
69160
|
+
if (errorNode) {
|
|
69161
|
+
error(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
|
69162
|
+
}
|
|
69163
|
+
return false;
|
|
69164
|
+
}
|
|
70047
69165
|
}
|
|
70048
69166
|
if (flags & 256 /* Abstract */ && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location) || isThisInitializedObjectBindingExpression(location) || isObjectBindingPattern(location.parent) && isThisInitializedDeclaration(location.parent.parent))) {
|
|
70049
69167
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
@@ -70449,11 +69567,17 @@ function createTypeChecker(host) {
|
|
|
70449
69567
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
70450
69568
|
}
|
|
70451
69569
|
function isUncheckedJSSuggestion(node, suggestion, excludeClasses) {
|
|
69570
|
+
var _a;
|
|
70452
69571
|
const file = getSourceFileOfNode(node);
|
|
70453
69572
|
if (file) {
|
|
70454
69573
|
if (compilerOptions.checkJs === void 0 && file.checkJsDirective === void 0 && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */)) {
|
|
70455
69574
|
const declarationFile = forEach(suggestion == null ? void 0 : suggestion.declarations, getSourceFileOfNode);
|
|
70456
|
-
|
|
69575
|
+
const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((_a = suggestion.valueDeclaration.heritageClauses) == null ? void 0 : _a.length) || classOrConstructorParameterIsDecorated(
|
|
69576
|
+
/*useLegacyDecorators*/
|
|
69577
|
+
false,
|
|
69578
|
+
suggestion.valueDeclaration
|
|
69579
|
+
);
|
|
69580
|
+
return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile)) && !(excludeClasses && suggestion && suggestion.flags & 32 /* Class */ && suggestionHasNoExtendsOrDecorators) && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === 110 /* ThisKeyword */ && suggestionHasNoExtendsOrDecorators);
|
|
70457
69581
|
}
|
|
70458
69582
|
}
|
|
70459
69583
|
return false;
|
|
@@ -110159,6 +109283,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
110159
109283
|
inlineSourceMap: compilerOptions.inlineSourceMap,
|
|
110160
109284
|
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
110161
109285
|
onlyPrintJsDocStyle: true,
|
|
109286
|
+
omitBraceSourceMapPositions: true,
|
|
110162
109287
|
writeBundleFileInfo: !!bundleBuildInfo,
|
|
110163
109288
|
recordInternalSection: !!bundleBuildInfo,
|
|
110164
109289
|
relativeToBuildInfo
|
|
@@ -110569,6 +109694,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
110569
109694
|
onAfterEmitToken
|
|
110570
109695
|
} = handlers;
|
|
110571
109696
|
var extendedDiagnostics = !!printerOptions.extendedDiagnostics;
|
|
109697
|
+
var omitBraceSourcePositions = !!printerOptions.omitBraceSourceMapPositions;
|
|
110572
109698
|
var newLine = getNewLineCharacter(printerOptions);
|
|
110573
109699
|
var moduleKind = getEmitModuleKind(printerOptions);
|
|
110574
109700
|
var bundledHelpers = /* @__PURE__ */ new Map();
|
|
@@ -112564,7 +111690,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112564
111690
|
decreaseIndent();
|
|
112565
111691
|
}
|
|
112566
111692
|
}
|
|
112567
|
-
|
|
111693
|
+
if (!omitBraceSourcePositions && (token === 19 /* OpenBraceToken */ || token === 20 /* CloseBraceToken */)) {
|
|
111694
|
+
pos = writeToken(token, pos, writer2, contextNode);
|
|
111695
|
+
} else {
|
|
111696
|
+
pos = writeTokenText(token, writer2, pos);
|
|
111697
|
+
}
|
|
112568
111698
|
if (isSimilarNode && contextNode.end !== pos) {
|
|
112569
111699
|
const isJsxExprContext = contextNode.kind === 294 /* JsxExpression */;
|
|
112570
111700
|
emitTrailingCommentsOfPosition(
|
|
@@ -115773,7 +114903,7 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
|
|
|
115773
114903
|
function createCompilerHost(options, setParentNodes) {
|
|
115774
114904
|
return createCompilerHostWorker(options, setParentNodes);
|
|
115775
114905
|
}
|
|
115776
|
-
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes
|
|
114906
|
+
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
|
|
115777
114907
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
115778
114908
|
let text;
|
|
115779
114909
|
try {
|
|
@@ -115787,15 +114917,7 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipN
|
|
|
115787
114917
|
}
|
|
115788
114918
|
text = "";
|
|
115789
114919
|
}
|
|
115790
|
-
return text !== void 0 ? createSourceFile(
|
|
115791
|
-
fileName,
|
|
115792
|
-
text,
|
|
115793
|
-
languageVersionOrOptions,
|
|
115794
|
-
setParentNodes,
|
|
115795
|
-
/*scriptKind*/
|
|
115796
|
-
void 0,
|
|
115797
|
-
skipNonSemanticJSDocParsing2
|
|
115798
|
-
) : void 0;
|
|
114920
|
+
return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0;
|
|
115799
114921
|
};
|
|
115800
114922
|
}
|
|
115801
114923
|
function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
|
|
@@ -115819,7 +114941,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
|
|
|
115819
114941
|
}
|
|
115820
114942
|
};
|
|
115821
114943
|
}
|
|
115822
|
-
function createCompilerHostWorker(options, setParentNodes,
|
|
114944
|
+
function createCompilerHostWorker(options, setParentNodes, system = sys) {
|
|
115823
114945
|
const existingDirectories = /* @__PURE__ */ new Map();
|
|
115824
114946
|
const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
|
115825
114947
|
function directoryExists(directoryPath) {
|
|
@@ -115838,7 +114960,7 @@ function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocP
|
|
|
115838
114960
|
const newLine = getNewLineCharacter(options);
|
|
115839
114961
|
const realpath = system.realpath && ((path) => system.realpath(path));
|
|
115840
114962
|
const compilerHost = {
|
|
115841
|
-
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes
|
|
114963
|
+
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
|
|
115842
114964
|
getDefaultLibLocation,
|
|
115843
114965
|
getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
|
|
115844
114966
|
writeFile: createWriteFileMeasuringIO(
|
|
@@ -116295,14 +115417,14 @@ function isReferenceFileLocation(location) {
|
|
|
116295
115417
|
return location.pos !== void 0;
|
|
116296
115418
|
}
|
|
116297
115419
|
function getReferencedFileLocation(program, ref) {
|
|
116298
|
-
var _a, _b, _c, _d
|
|
115420
|
+
var _a, _b, _c, _d;
|
|
116299
115421
|
const file = Debug.checkDefined(program.getSourceFileByPath(ref.file));
|
|
116300
115422
|
const { kind, index } = ref;
|
|
116301
115423
|
let pos, end, packageId, resolutionMode;
|
|
116302
115424
|
switch (kind) {
|
|
116303
115425
|
case 3 /* Import */:
|
|
116304
115426
|
const importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
116305
|
-
packageId = (
|
|
115427
|
+
packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.packageId;
|
|
116306
115428
|
if (importLiteral.pos === -1)
|
|
116307
115429
|
return { file, packageId, text: importLiteral.text };
|
|
116308
115430
|
pos = skipTrivia(file.text, importLiteral.pos);
|
|
@@ -116313,7 +115435,7 @@ function getReferencedFileLocation(program, ref) {
|
|
|
116313
115435
|
break;
|
|
116314
115436
|
case 5 /* TypeReferenceDirective */:
|
|
116315
115437
|
({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]);
|
|
116316
|
-
packageId = (
|
|
115438
|
+
packageId = (_d = (_c = program.getResolvedTypeReferenceDirective(file, toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _c.resolvedTypeReferenceDirective) == null ? void 0 : _d.packageId;
|
|
116317
115439
|
break;
|
|
116318
115440
|
case 7 /* LibReferenceDirective */:
|
|
116319
115441
|
({ pos, end } = file.libReferenceDirectives[index]);
|
|
@@ -116841,6 +115963,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116841
115963
|
resolvedModules,
|
|
116842
115964
|
resolvedTypeReferenceDirectiveNames,
|
|
116843
115965
|
resolvedLibReferences,
|
|
115966
|
+
getResolvedModule,
|
|
115967
|
+
getResolvedTypeReferenceDirective,
|
|
115968
|
+
forEachResolvedModule,
|
|
115969
|
+
forEachResolvedTypeReferenceDirective,
|
|
116844
115970
|
getCurrentPackagesMap: () => packageMap,
|
|
116845
115971
|
typesPackageExists,
|
|
116846
115972
|
packageBundlesTypes,
|
|
@@ -116884,19 +116010,35 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116884
116010
|
measure("Program", "beforeProgram", "afterProgram");
|
|
116885
116011
|
(_p = tracing) == null ? void 0 : _p.pop();
|
|
116886
116012
|
return program;
|
|
116013
|
+
function getResolvedModule(file, moduleName, mode) {
|
|
116014
|
+
var _a2;
|
|
116015
|
+
return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a2.get(moduleName, mode);
|
|
116016
|
+
}
|
|
116017
|
+
function getResolvedTypeReferenceDirective(file, typeDirectiveName, mode) {
|
|
116018
|
+
var _a2;
|
|
116019
|
+
return (_a2 = resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.get(file.path)) == null ? void 0 : _a2.get(typeDirectiveName, mode);
|
|
116020
|
+
}
|
|
116021
|
+
function forEachResolvedModule(callback, file) {
|
|
116022
|
+
forEachResolution(resolvedModules, callback, file);
|
|
116023
|
+
}
|
|
116024
|
+
function forEachResolvedTypeReferenceDirective(callback, file) {
|
|
116025
|
+
forEachResolution(resolvedTypeReferenceDirectiveNames, callback, file);
|
|
116026
|
+
}
|
|
116027
|
+
function forEachResolution(resolutionCache, callback, file) {
|
|
116028
|
+
var _a2;
|
|
116029
|
+
if (file)
|
|
116030
|
+
(_a2 = resolutionCache == null ? void 0 : resolutionCache.get(file.path)) == null ? void 0 : _a2.forEach((resolution, name, mode) => callback(resolution, name, mode, file.path));
|
|
116031
|
+
else
|
|
116032
|
+
resolutionCache == null ? void 0 : resolutionCache.forEach((resolutions, filePath) => resolutions.forEach((resolution, name, mode) => callback(resolution, name, mode, filePath)));
|
|
116033
|
+
}
|
|
116887
116034
|
function getPackagesMap() {
|
|
116888
116035
|
if (packageMap)
|
|
116889
116036
|
return packageMap;
|
|
116890
116037
|
packageMap = /* @__PURE__ */ new Map();
|
|
116891
|
-
|
|
116892
|
-
(
|
|
116893
|
-
|
|
116894
|
-
|
|
116895
|
-
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
116896
|
-
packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
|
|
116897
|
-
});
|
|
116898
|
-
}
|
|
116899
|
-
);
|
|
116038
|
+
forEachResolvedModule(({ resolvedModule }) => {
|
|
116039
|
+
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
116040
|
+
packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
|
|
116041
|
+
});
|
|
116900
116042
|
return packageMap;
|
|
116901
116043
|
}
|
|
116902
116044
|
function typesPackageExists(packageName) {
|
|
@@ -117028,7 +116170,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117028
116170
|
return classifiableNames;
|
|
117029
116171
|
}
|
|
117030
116172
|
function resolveModuleNamesReusingOldState(moduleNames, file) {
|
|
117031
|
-
var _a2, _b2;
|
|
117032
116173
|
if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {
|
|
117033
116174
|
return resolveModuleNamesWorker(
|
|
117034
116175
|
moduleNames,
|
|
@@ -117046,7 +116187,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117046
116187
|
const moduleName = moduleNames[i];
|
|
117047
116188
|
if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
|
|
117048
116189
|
const mode = getModeForUsageLocation(file, moduleName);
|
|
117049
|
-
const oldResolution =
|
|
116190
|
+
const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, mode);
|
|
117050
116191
|
if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
|
|
117051
116192
|
if (isTraceEnabled(options, host)) {
|
|
117052
116193
|
trace(
|
|
@@ -117093,8 +116234,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117093
116234
|
Debug.assert(j === resolutions.length);
|
|
117094
116235
|
return result;
|
|
117095
116236
|
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
|
|
117096
|
-
var
|
|
117097
|
-
const resolutionToFile = (
|
|
116237
|
+
var _a2;
|
|
116238
|
+
const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _a2.resolvedModule;
|
|
117098
116239
|
const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
|
|
117099
116240
|
if (resolutionToFile && resolvedFile) {
|
|
117100
116241
|
return false;
|
|
@@ -117110,7 +116251,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117110
116251
|
}
|
|
117111
116252
|
}
|
|
117112
116253
|
function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) {
|
|
117113
|
-
var _a2
|
|
116254
|
+
var _a2;
|
|
117114
116255
|
if (structureIsReused === 0 /* Not */) {
|
|
117115
116256
|
return resolveTypeReferenceDirectiveNamesWorker(
|
|
117116
116257
|
typeDirectiveNames,
|
|
@@ -117130,7 +116271,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117130
116271
|
if (canReuseResolutions) {
|
|
117131
116272
|
const typeDirectiveName = getTypeReferenceResolutionName(entry);
|
|
117132
116273
|
const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat);
|
|
117133
|
-
const oldResolution =
|
|
116274
|
+
const oldResolution = !isString(containingFile) ? oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(containingFile, typeDirectiveName, mode) : (_a2 = oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a2.get(typeDirectiveName, mode);
|
|
117134
116275
|
if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) {
|
|
117135
116276
|
if (isTraceEnabled(options, host)) {
|
|
117136
116277
|
trace(
|
|
@@ -117190,7 +116331,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117190
116331
|
);
|
|
117191
116332
|
}
|
|
117192
116333
|
function tryReuseStructureFromOldProgram() {
|
|
117193
|
-
var _a2
|
|
116334
|
+
var _a2;
|
|
117194
116335
|
if (!oldProgram) {
|
|
117195
116336
|
return 0 /* Not */;
|
|
117196
116337
|
}
|
|
@@ -117310,20 +116451,29 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117310
116451
|
const moduleNames = getModuleNames(newSourceFile);
|
|
117311
116452
|
const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
|
|
117312
116453
|
(resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions);
|
|
117313
|
-
const
|
|
117314
|
-
|
|
116454
|
+
const resolutionsChanged = hasChangesInResolutions(
|
|
116455
|
+
moduleNames,
|
|
116456
|
+
newSourceFile,
|
|
116457
|
+
resolutions,
|
|
116458
|
+
(name, mode) => oldProgram.getResolvedModule(newSourceFile, name, mode),
|
|
116459
|
+
moduleResolutionIsEqualTo,
|
|
116460
|
+
moduleResolutionNameAndModeGetter
|
|
116461
|
+
);
|
|
117315
116462
|
if (resolutionsChanged)
|
|
117316
116463
|
structureIsReused = 1 /* SafeModules */;
|
|
117317
116464
|
const typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
|
|
117318
116465
|
const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile);
|
|
117319
116466
|
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions);
|
|
117320
|
-
const
|
|
117321
|
-
|
|
117322
|
-
|
|
116467
|
+
const typeReferenceResolutionsChanged = hasChangesInResolutions(
|
|
116468
|
+
typesReferenceDirectives,
|
|
116469
|
+
newSourceFile,
|
|
116470
|
+
typeReferenceResolutions,
|
|
116471
|
+
(name, mode) => oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(newSourceFile, name, mode),
|
|
116472
|
+
typeDirectiveIsEqualTo,
|
|
116473
|
+
typeReferenceResolutionNameAndModeGetter
|
|
116474
|
+
);
|
|
116475
|
+
if (typeReferenceResolutionsChanged)
|
|
117323
116476
|
structureIsReused = 1 /* SafeModules */;
|
|
117324
|
-
} else if (oldTypeResolutions) {
|
|
117325
|
-
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, oldTypeResolutions);
|
|
117326
|
-
}
|
|
117327
116477
|
}
|
|
117328
116478
|
if (structureIsReused !== 2 /* Completely */) {
|
|
117329
116479
|
return structureIsReused;
|
|
@@ -118193,7 +117343,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118193
117343
|
const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
|
|
118194
117344
|
const languageVersion = getEmitScriptTarget(options2);
|
|
118195
117345
|
const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
|
|
118196
|
-
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
|
|
117346
|
+
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode };
|
|
118197
117347
|
}
|
|
118198
117348
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
|
118199
117349
|
var _a2;
|
|
@@ -119470,7 +118620,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119470
118620
|
symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
|
|
119471
118621
|
}
|
|
119472
118622
|
if (files && !symlinks.hasProcessedResolutions()) {
|
|
119473
|
-
symlinks.setSymlinksFromResolutions(
|
|
118623
|
+
symlinks.setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, automaticTypeDirectiveResolutions);
|
|
119474
118624
|
}
|
|
119475
118625
|
return symlinks;
|
|
119476
118626
|
}
|
|
@@ -119824,7 +118974,6 @@ var BuilderState;
|
|
|
119824
118974
|
return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);
|
|
119825
118975
|
}
|
|
119826
118976
|
function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
|
|
119827
|
-
var _a;
|
|
119828
118977
|
let referencedFiles;
|
|
119829
118978
|
if (sourceFile.imports && sourceFile.imports.length > 0) {
|
|
119830
118979
|
const checker = program.getTypeChecker();
|
|
@@ -119840,17 +118989,14 @@ var BuilderState;
|
|
|
119840
118989
|
addReferencedFile(referencedPath);
|
|
119841
118990
|
}
|
|
119842
118991
|
}
|
|
119843
|
-
|
|
119844
|
-
|
|
119845
|
-
|
|
119846
|
-
|
|
119847
|
-
|
|
119848
|
-
|
|
119849
|
-
|
|
119850
|
-
|
|
119851
|
-
addReferencedFile(typeFilePath);
|
|
119852
|
-
});
|
|
119853
|
-
}
|
|
118992
|
+
program.forEachResolvedTypeReferenceDirective(({ resolvedTypeReferenceDirective }) => {
|
|
118993
|
+
if (!resolvedTypeReferenceDirective) {
|
|
118994
|
+
return;
|
|
118995
|
+
}
|
|
118996
|
+
const fileName = resolvedTypeReferenceDirective.resolvedFileName;
|
|
118997
|
+
const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);
|
|
118998
|
+
addReferencedFile(typeFilePath);
|
|
118999
|
+
}, sourceFile);
|
|
119854
119000
|
if (sourceFile.moduleAugmentations.length) {
|
|
119855
119001
|
const checker = program.getTypeChecker();
|
|
119856
119002
|
for (const moduleName of sourceFile.moduleAugmentations) {
|
|
@@ -121568,6 +120714,47 @@ function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirec
|
|
|
121568
120714
|
const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory());
|
|
121569
120715
|
return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized;
|
|
121570
120716
|
}
|
|
120717
|
+
function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) {
|
|
120718
|
+
return {
|
|
120719
|
+
nameAndMode: moduleResolutionNameAndModeGetter,
|
|
120720
|
+
resolve: (moduleName, resoluionMode) => resolveModuleNameUsingGlobalCache(
|
|
120721
|
+
resolutionHost,
|
|
120722
|
+
moduleResolutionCache,
|
|
120723
|
+
moduleName,
|
|
120724
|
+
containingFile,
|
|
120725
|
+
options,
|
|
120726
|
+
redirectedReference,
|
|
120727
|
+
resoluionMode
|
|
120728
|
+
)
|
|
120729
|
+
};
|
|
120730
|
+
}
|
|
120731
|
+
function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
|
|
120732
|
+
var _a;
|
|
120733
|
+
const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
120734
|
+
const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
120735
|
+
if (!resolutionHost.getGlobalCache) {
|
|
120736
|
+
return primaryResult;
|
|
120737
|
+
}
|
|
120738
|
+
const globalCache = resolutionHost.getGlobalCache();
|
|
120739
|
+
if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
|
|
120740
|
+
const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
|
|
120741
|
+
Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
|
|
120742
|
+
resolutionHost.projectName,
|
|
120743
|
+
compilerOptions,
|
|
120744
|
+
host,
|
|
120745
|
+
globalCache,
|
|
120746
|
+
moduleResolutionCache
|
|
120747
|
+
);
|
|
120748
|
+
if (resolvedModule) {
|
|
120749
|
+
primaryResult.resolvedModule = resolvedModule;
|
|
120750
|
+
primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
|
|
120751
|
+
primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
|
|
120752
|
+
primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
|
|
120753
|
+
return primaryResult;
|
|
120754
|
+
}
|
|
120755
|
+
}
|
|
120756
|
+
return primaryResult;
|
|
120757
|
+
}
|
|
121571
120758
|
function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
|
|
121572
120759
|
let filesWithChangedSetOfUnresolvedImports;
|
|
121573
120760
|
let filesWithInvalidatedResolutions;
|
|
@@ -121614,6 +120801,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121614
120801
|
const rootPathComponents = getPathComponents(rootPath);
|
|
121615
120802
|
const typeRootsWatches = /* @__PURE__ */ new Map();
|
|
121616
120803
|
return {
|
|
120804
|
+
rootDirForResolution,
|
|
120805
|
+
resolvedModuleNames,
|
|
120806
|
+
resolvedTypeReferenceDirectives,
|
|
120807
|
+
resolvedLibraries,
|
|
120808
|
+
resolvedFileToResolution,
|
|
120809
|
+
resolutionsWithFailedLookups,
|
|
120810
|
+
resolutionsWithOnlyAffectingLocations,
|
|
120811
|
+
directoryWatchesOfFailedLookups,
|
|
120812
|
+
fileWatchesOfAffectingLocations,
|
|
120813
|
+
watchFailedLookupLocationsOfExternalModuleResolutions,
|
|
121617
120814
|
getModuleResolutionCache: () => moduleResolutionCache,
|
|
121618
120815
|
startRecordingFilesWithChangedResolutions,
|
|
121619
120816
|
finishRecordingFilesWithChangedResolutions,
|
|
@@ -121716,7 +120913,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121716
120913
|
if (!((_a = newProgram == null ? void 0 : newProgram.resolvedLibReferences) == null ? void 0 : _a.has(libFileName))) {
|
|
121717
120914
|
stopWatchFailedLookupLocationOfResolution(
|
|
121718
120915
|
resolution,
|
|
121719
|
-
resolutionHost.toPath(getInferredLibraryNameResolveFrom(
|
|
120916
|
+
resolutionHost.toPath(getInferredLibraryNameResolveFrom(resolutionHost.getCompilationSettings(), getCurrentDirectory(), libFileName)),
|
|
121720
120917
|
getResolvedModule
|
|
121721
120918
|
);
|
|
121722
120919
|
resolvedLibraries.delete(libFileName);
|
|
@@ -121758,58 +120955,22 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121758
120955
|
}
|
|
121759
120956
|
});
|
|
121760
120957
|
}
|
|
121761
|
-
directoryWatchesOfFailedLookups.forEach(
|
|
121762
|
-
|
|
121763
|
-
directoryWatchesOfFailedLookups.delete(path);
|
|
121764
|
-
watcher.watcher.close();
|
|
121765
|
-
}
|
|
121766
|
-
});
|
|
121767
|
-
fileWatchesOfAffectingLocations.forEach((watcher, path) => {
|
|
121768
|
-
if (watcher.files === 0 && watcher.resolutions === 0) {
|
|
121769
|
-
fileWatchesOfAffectingLocations.delete(path);
|
|
121770
|
-
watcher.watcher.close();
|
|
121771
|
-
}
|
|
121772
|
-
});
|
|
120958
|
+
directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
|
|
120959
|
+
fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
|
|
121773
120960
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
121774
120961
|
}
|
|
121775
|
-
function
|
|
121776
|
-
|
|
121777
|
-
|
|
121778
|
-
|
|
121779
|
-
if (!resolutionHost.getGlobalCache) {
|
|
121780
|
-
return primaryResult;
|
|
121781
|
-
}
|
|
121782
|
-
const globalCache = resolutionHost.getGlobalCache();
|
|
121783
|
-
if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
|
|
121784
|
-
const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
|
|
121785
|
-
Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
|
|
121786
|
-
resolutionHost.projectName,
|
|
121787
|
-
compilerOptions,
|
|
121788
|
-
host,
|
|
121789
|
-
globalCache,
|
|
121790
|
-
moduleResolutionCache
|
|
121791
|
-
);
|
|
121792
|
-
if (resolvedModule) {
|
|
121793
|
-
primaryResult.resolvedModule = resolvedModule;
|
|
121794
|
-
primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
|
|
121795
|
-
primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
|
|
121796
|
-
primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
|
|
121797
|
-
return primaryResult;
|
|
121798
|
-
}
|
|
120962
|
+
function closeDirectoryWatchesOfFailedLookup(watcher, path) {
|
|
120963
|
+
if (watcher.refCount === 0) {
|
|
120964
|
+
directoryWatchesOfFailedLookups.delete(path);
|
|
120965
|
+
watcher.watcher.close();
|
|
121799
120966
|
}
|
|
121800
|
-
return primaryResult;
|
|
121801
120967
|
}
|
|
121802
|
-
function
|
|
121803
|
-
|
|
121804
|
-
|
|
121805
|
-
|
|
121806
|
-
|
|
121807
|
-
|
|
121808
|
-
options,
|
|
121809
|
-
redirectedReference,
|
|
121810
|
-
resoluionMode
|
|
121811
|
-
)
|
|
121812
|
-
};
|
|
120968
|
+
function closeFileWatcherOfAffectingLocation(watcher, path) {
|
|
120969
|
+
var _a;
|
|
120970
|
+
if (watcher.files === 0 && watcher.resolutions === 0 && !((_a = watcher.symlinks) == null ? void 0 : _a.size)) {
|
|
120971
|
+
fileWatchesOfAffectingLocations.delete(path);
|
|
120972
|
+
watcher.watcher.close();
|
|
120973
|
+
}
|
|
121813
120974
|
}
|
|
121814
120975
|
function resolveNamesWithLocalCache({
|
|
121815
120976
|
entries,
|
|
@@ -121846,9 +121007,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121846
121007
|
resolutionHost.onDiscoveredSymlink();
|
|
121847
121008
|
}
|
|
121848
121009
|
resolutionsInFile.set(name, mode, resolution);
|
|
121849
|
-
|
|
121850
|
-
|
|
121851
|
-
|
|
121010
|
+
if (resolution !== existingResolution) {
|
|
121011
|
+
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
|
|
121012
|
+
if (existingResolution) {
|
|
121013
|
+
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
|
|
121014
|
+
}
|
|
121852
121015
|
}
|
|
121853
121016
|
if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) {
|
|
121854
121017
|
filesWithChangedSetOfUnresolvedImports.push(path);
|
|
@@ -121937,10 +121100,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121937
121100
|
options,
|
|
121938
121101
|
reusedNames,
|
|
121939
121102
|
perFileCache: resolvedModuleNames,
|
|
121940
|
-
loader:
|
|
121103
|
+
loader: createModuleResolutionLoaderUsingGlobalCache(
|
|
121941
121104
|
containingFile,
|
|
121942
121105
|
redirectedReference,
|
|
121943
|
-
options
|
|
121106
|
+
options,
|
|
121107
|
+
resolutionHost,
|
|
121108
|
+
moduleResolutionCache
|
|
121944
121109
|
),
|
|
121945
121110
|
getResolutionWithResolvedFileName: getResolvedModule,
|
|
121946
121111
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
@@ -121994,7 +121159,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121994
121159
|
);
|
|
121995
121160
|
if (resolution && !resolution.isInvalidated)
|
|
121996
121161
|
return resolution;
|
|
121997
|
-
return
|
|
121162
|
+
return resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, resolutionHost.getCompilationSettings());
|
|
121998
121163
|
}
|
|
121999
121164
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
122000
121165
|
return endsWith(dirPath, "/node_modules/@types");
|
|
@@ -122094,52 +121259,63 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122094
121259
|
return;
|
|
122095
121260
|
}
|
|
122096
121261
|
let locationToWatch = affectingLocation;
|
|
121262
|
+
let isSymlink = false;
|
|
121263
|
+
let symlinkWatcher;
|
|
122097
121264
|
if (resolutionHost.realpath) {
|
|
122098
121265
|
locationToWatch = resolutionHost.realpath(affectingLocation);
|
|
122099
121266
|
if (affectingLocation !== locationToWatch) {
|
|
122100
|
-
|
|
122101
|
-
|
|
122102
|
-
|
|
122103
|
-
|
|
122104
|
-
|
|
122105
|
-
|
|
122106
|
-
|
|
122107
|
-
|
|
122108
|
-
|
|
122109
|
-
|
|
122110
|
-
|
|
122111
|
-
|
|
122112
|
-
|
|
122113
|
-
|
|
122114
|
-
|
|
122115
|
-
|
|
122116
|
-
|
|
122117
|
-
|
|
122118
|
-
|
|
122119
|
-
|
|
122120
|
-
|
|
122121
|
-
|
|
122122
|
-
|
|
122123
|
-
|
|
122124
|
-
|
|
122125
|
-
|
|
122126
|
-
|
|
122127
|
-
|
|
122128
|
-
|
|
122129
|
-
|
|
122130
|
-
|
|
122131
|
-
|
|
122132
|
-
|
|
122133
|
-
|
|
122134
|
-
|
|
122135
|
-
|
|
122136
|
-
|
|
122137
|
-
|
|
122138
|
-
if (affectingLocation !== locationToWatch) {
|
|
121267
|
+
isSymlink = true;
|
|
121268
|
+
symlinkWatcher = fileWatchesOfAffectingLocations.get(locationToWatch);
|
|
121269
|
+
}
|
|
121270
|
+
}
|
|
121271
|
+
const resolutions = forResolution ? 1 : 0;
|
|
121272
|
+
const files = forResolution ? 0 : 1;
|
|
121273
|
+
if (!isSymlink || !symlinkWatcher) {
|
|
121274
|
+
const watcher = {
|
|
121275
|
+
watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
|
|
121276
|
+
cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
|
121277
|
+
invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache().getInternalMap());
|
|
121278
|
+
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
121279
|
+
}) : noopFileWatcher,
|
|
121280
|
+
resolutions: isSymlink ? 0 : resolutions,
|
|
121281
|
+
files: isSymlink ? 0 : files,
|
|
121282
|
+
symlinks: void 0
|
|
121283
|
+
};
|
|
121284
|
+
fileWatchesOfAffectingLocations.set(locationToWatch, watcher);
|
|
121285
|
+
if (isSymlink)
|
|
121286
|
+
symlinkWatcher = watcher;
|
|
121287
|
+
}
|
|
121288
|
+
if (isSymlink) {
|
|
121289
|
+
Debug.assert(!!symlinkWatcher);
|
|
121290
|
+
const watcher = {
|
|
121291
|
+
watcher: {
|
|
121292
|
+
close: () => {
|
|
121293
|
+
var _a;
|
|
121294
|
+
const symlinkWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch);
|
|
121295
|
+
if (((_a = symlinkWatcher2 == null ? void 0 : symlinkWatcher2.symlinks) == null ? void 0 : _a.delete(affectingLocation)) && !symlinkWatcher2.symlinks.size && !symlinkWatcher2.resolutions && !symlinkWatcher2.files) {
|
|
121296
|
+
fileWatchesOfAffectingLocations.delete(locationToWatch);
|
|
121297
|
+
symlinkWatcher2.watcher.close();
|
|
121298
|
+
}
|
|
121299
|
+
}
|
|
121300
|
+
},
|
|
121301
|
+
resolutions,
|
|
121302
|
+
files,
|
|
121303
|
+
symlinks: void 0
|
|
121304
|
+
};
|
|
122139
121305
|
fileWatchesOfAffectingLocations.set(affectingLocation, watcher);
|
|
122140
|
-
|
|
121306
|
+
(symlinkWatcher.symlinks ?? (symlinkWatcher.symlinks = /* @__PURE__ */ new Set())).add(affectingLocation);
|
|
122141
121307
|
}
|
|
122142
121308
|
}
|
|
121309
|
+
function invalidateAffectingFileWatcher(path, packageJsonMap) {
|
|
121310
|
+
var _a;
|
|
121311
|
+
const watcher = fileWatchesOfAffectingLocations.get(path);
|
|
121312
|
+
if (watcher == null ? void 0 : watcher.resolutions)
|
|
121313
|
+
(affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path);
|
|
121314
|
+
if (watcher == null ? void 0 : watcher.files)
|
|
121315
|
+
(affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path);
|
|
121316
|
+
(_a = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a.forEach((path2) => invalidateAffectingFileWatcher(path2, packageJsonMap));
|
|
121317
|
+
packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
|
|
121318
|
+
}
|
|
122143
121319
|
function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
|
|
122144
121320
|
const program = resolutionHost.getCurrentProgram();
|
|
122145
121321
|
if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {
|
|
@@ -122161,7 +121337,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122161
121337
|
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive });
|
|
122162
121338
|
}
|
|
122163
121339
|
}
|
|
122164
|
-
function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot) {
|
|
121340
|
+
function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove) {
|
|
122165
121341
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
122166
121342
|
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
122167
121343
|
failedLookupLocation,
|
|
@@ -122176,12 +121352,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122176
121352
|
if (dirPath === rootPath) {
|
|
122177
121353
|
removeAtRoot = true;
|
|
122178
121354
|
} else {
|
|
122179
|
-
removeDirectoryWatcher(dirPath);
|
|
121355
|
+
removeDirectoryWatcher(dirPath, syncDirWatcherRemove);
|
|
122180
121356
|
}
|
|
122181
121357
|
}
|
|
122182
121358
|
return removeAtRoot;
|
|
122183
121359
|
}
|
|
122184
|
-
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
|
|
121360
|
+
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
|
|
122185
121361
|
Debug.checkDefined(resolution.files).delete(filePath);
|
|
122186
121362
|
resolution.refCount--;
|
|
122187
121363
|
if (resolution.refCount) {
|
|
@@ -122199,13 +121375,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122199
121375
|
let removeAtRoot = false;
|
|
122200
121376
|
if (failedLookupLocations) {
|
|
122201
121377
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
122202
|
-
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot);
|
|
121378
|
+
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
|
|
122203
121379
|
}
|
|
122204
121380
|
}
|
|
122205
121381
|
if (node10Result)
|
|
122206
|
-
removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot);
|
|
121382
|
+
removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot, syncDirWatcherRemove);
|
|
122207
121383
|
if (removeAtRoot)
|
|
122208
|
-
removeDirectoryWatcher(rootPath);
|
|
121384
|
+
removeDirectoryWatcher(rootPath, syncDirWatcherRemove);
|
|
122209
121385
|
} else if (affectingLocations == null ? void 0 : affectingLocations.length) {
|
|
122210
121386
|
resolutionsWithOnlyAffectingLocations.delete(resolution);
|
|
122211
121387
|
}
|
|
@@ -122213,12 +121389,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122213
121389
|
for (const affectingLocation of affectingLocations) {
|
|
122214
121390
|
const watcher = fileWatchesOfAffectingLocations.get(affectingLocation);
|
|
122215
121391
|
watcher.resolutions--;
|
|
121392
|
+
if (syncDirWatcherRemove)
|
|
121393
|
+
closeFileWatcherOfAffectingLocation(watcher, affectingLocation);
|
|
122216
121394
|
}
|
|
122217
121395
|
}
|
|
122218
121396
|
}
|
|
122219
|
-
function removeDirectoryWatcher(dirPath) {
|
|
121397
|
+
function removeDirectoryWatcher(dirPath, syncDirWatcherRemove) {
|
|
122220
121398
|
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
|
122221
121399
|
dirWatcher.refCount--;
|
|
121400
|
+
if (syncDirWatcherRemove)
|
|
121401
|
+
closeDirectoryWatchesOfFailedLookup(dirWatcher, dirPath);
|
|
122222
121402
|
}
|
|
122223
121403
|
function createDirectoryWatcher(directory, dirPath, nonRecursive) {
|
|
122224
121404
|
return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, (fileOrDirectory) => {
|
|
@@ -122229,10 +121409,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122229
121409
|
scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);
|
|
122230
121410
|
}, nonRecursive ? 0 /* None */ : 1 /* Recursive */);
|
|
122231
121411
|
}
|
|
122232
|
-
function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) {
|
|
121412
|
+
function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
|
|
122233
121413
|
const resolutions = cache.get(filePath);
|
|
122234
121414
|
if (resolutions) {
|
|
122235
|
-
resolutions.forEach(
|
|
121415
|
+
resolutions.forEach(
|
|
121416
|
+
(resolution) => stopWatchFailedLookupLocationOfResolution(
|
|
121417
|
+
resolution,
|
|
121418
|
+
filePath,
|
|
121419
|
+
getResolutionWithResolvedFileName,
|
|
121420
|
+
syncDirWatcherRemove
|
|
121421
|
+
)
|
|
121422
|
+
);
|
|
122236
121423
|
cache.delete(filePath);
|
|
122237
121424
|
}
|
|
122238
121425
|
}
|
|
@@ -122247,9 +121434,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
122247
121434
|
return;
|
|
122248
121435
|
resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f)));
|
|
122249
121436
|
}
|
|
122250
|
-
function removeResolutionsOfFile(filePath) {
|
|
122251
|
-
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule);
|
|
122252
|
-
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective);
|
|
121437
|
+
function removeResolutionsOfFile(filePath, syncDirWatcherRemove) {
|
|
121438
|
+
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule, syncDirWatcherRemove);
|
|
121439
|
+
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective, syncDirWatcherRemove);
|
|
122253
121440
|
}
|
|
122254
121441
|
function invalidateResolutions(resolutions, canInvalidate) {
|
|
122255
121442
|
if (!resolutions)
|
|
@@ -122903,8 +122090,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
122903
122090
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
122904
122091
|
getCompilerOptions,
|
|
122905
122092
|
/*setParentNodes*/
|
|
122906
|
-
void 0
|
|
122907
|
-
host.skipNonSemanticJSDocParsing
|
|
122093
|
+
void 0
|
|
122908
122094
|
),
|
|
122909
122095
|
getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
|
|
122910
122096
|
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
|
|
@@ -122926,7 +122112,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
122926
122112
|
getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
|
|
122927
122113
|
createHash: maybeBind(host, host.createHash),
|
|
122928
122114
|
readDirectory: maybeBind(host, host.readDirectory),
|
|
122929
|
-
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
|
|
122115
|
+
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
122116
|
+
jsDocParsingMode: host.jsDocParsingMode
|
|
122930
122117
|
};
|
|
122931
122118
|
return compilerHost;
|
|
122932
122119
|
}
|
|
@@ -123090,12 +122277,11 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
123090
122277
|
return void 0;
|
|
123091
122278
|
return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
|
|
123092
122279
|
}
|
|
123093
|
-
function createIncrementalCompilerHost(options, system = sys
|
|
122280
|
+
function createIncrementalCompilerHost(options, system = sys) {
|
|
123094
122281
|
const host = createCompilerHostWorker(
|
|
123095
122282
|
options,
|
|
123096
122283
|
/*setParentNodes*/
|
|
123097
122284
|
void 0,
|
|
123098
|
-
skipNonSemanticJSDocParsing2,
|
|
123099
122285
|
system
|
|
123100
122286
|
);
|
|
123101
122287
|
host.createHash = maybeBind(system, system.createHash);
|
|
@@ -123212,7 +122398,7 @@ function createWatchProgram(host) {
|
|
|
123212
122398
|
watchConfigFileWildCardDirectories();
|
|
123213
122399
|
if (configFileName)
|
|
123214
122400
|
updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
|
|
123215
|
-
return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close };
|
|
122401
|
+
return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache };
|
|
123216
122402
|
function close() {
|
|
123217
122403
|
clearInvalidateResolutionsOfFailedLookupLocations();
|
|
123218
122404
|
resolutionCache.clear();
|
|
@@ -123252,6 +122438,9 @@ function createWatchProgram(host) {
|
|
|
123252
122438
|
parsedConfigs = void 0;
|
|
123253
122439
|
}
|
|
123254
122440
|
}
|
|
122441
|
+
function getResolutionCache() {
|
|
122442
|
+
return resolutionCache;
|
|
122443
|
+
}
|
|
123255
122444
|
function getCurrentBuilderProgram() {
|
|
123256
122445
|
return builderProgram;
|
|
123257
122446
|
}
|
|
@@ -126425,7 +125614,7 @@ function reportWatchModeWithoutSysSupport(sys2, reportDiagnostic) {
|
|
|
126425
125614
|
}
|
|
126426
125615
|
return false;
|
|
126427
125616
|
}
|
|
126428
|
-
var
|
|
125617
|
+
var defaultJSDocParsingMode = 2 /* ParseForTypeErrors */;
|
|
126429
125618
|
function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
126430
125619
|
const reportDiagnostic = updateReportDiagnostic(
|
|
126431
125620
|
sys2,
|
|
@@ -126464,7 +125653,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
|
126464
125653
|
createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
|
|
126465
125654
|
createWatchStatusReporter2(sys2, buildOptions)
|
|
126466
125655
|
);
|
|
126467
|
-
buildHost2.
|
|
125656
|
+
buildHost2.jsDocParsingMode = defaultJSDocParsingMode;
|
|
126468
125657
|
const solutionPerformance2 = enableSolutionPerformance(sys2, buildOptions);
|
|
126469
125658
|
updateSolutionBuilderHost(sys2, cb, buildHost2, solutionPerformance2);
|
|
126470
125659
|
const onWatchStatusChange = buildHost2.onWatchStatusChange;
|
|
@@ -126489,7 +125678,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
|
126489
125678
|
createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
|
|
126490
125679
|
createReportErrorSummary(sys2, buildOptions)
|
|
126491
125680
|
);
|
|
126492
|
-
buildHost.
|
|
125681
|
+
buildHost.jsDocParsingMode = defaultJSDocParsingMode;
|
|
126493
125682
|
const solutionPerformance = enableSolutionPerformance(sys2, buildOptions);
|
|
126494
125683
|
updateSolutionBuilderHost(sys2, cb, buildHost, solutionPerformance);
|
|
126495
125684
|
const builder = createSolutionBuilder(buildHost, projects, buildOptions);
|
|
@@ -126507,9 +125696,9 @@ function performCompilation(sys2, cb, reportDiagnostic, config) {
|
|
|
126507
125696
|
options,
|
|
126508
125697
|
/*setParentNodes*/
|
|
126509
125698
|
void 0,
|
|
126510
|
-
skipNonSemanticJSDocParsing,
|
|
126511
125699
|
sys2
|
|
126512
125700
|
);
|
|
125701
|
+
host.jsDocParsingMode = defaultJSDocParsingMode;
|
|
126513
125702
|
const currentDirectory = host.getCurrentDirectory();
|
|
126514
125703
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
126515
125704
|
changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, currentDirectory, getCanonicalFileName));
|
|
@@ -126550,7 +125739,8 @@ function performIncrementalCompilation2(sys2, cb, reportDiagnostic, config) {
|
|
|
126550
125739
|
/*isBuildMode*/
|
|
126551
125740
|
false
|
|
126552
125741
|
);
|
|
126553
|
-
const host = createIncrementalCompilerHost(options, sys2
|
|
125742
|
+
const host = createIncrementalCompilerHost(options, sys2);
|
|
125743
|
+
host.jsDocParsingMode = defaultJSDocParsingMode;
|
|
126554
125744
|
const exitStatus = performIncrementalCompilation({
|
|
126555
125745
|
host,
|
|
126556
125746
|
system: sys2,
|
|
@@ -126605,7 +125795,7 @@ function updateCreateProgram(sys2, host, isBuildMode) {
|
|
|
126605
125795
|
};
|
|
126606
125796
|
}
|
|
126607
125797
|
function updateWatchCompilationHost(sys2, cb, watchCompilerHost) {
|
|
126608
|
-
watchCompilerHost.
|
|
125798
|
+
watchCompilerHost.jsDocParsingMode = defaultJSDocParsingMode;
|
|
126609
125799
|
updateCreateProgram(
|
|
126610
125800
|
sys2,
|
|
126611
125801
|
watchCompilerHost,
|