@typescript-deploys/pr-build 5.4.0-pr-55600-40 → 5.4.0-pr-55774-21
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 +163 -1051
- package/lib/tsserver.js +178 -1064
- package/lib/typescript.d.ts +3 -3
- package/lib/typescript.js +180 -1063
- package/lib/typingsInstaller.js +71 -996
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -146,7 +146,6 @@ __export(server_exports, {
|
|
|
146
146
|
ProcessLevel: () => ProcessLevel,
|
|
147
147
|
ProgramUpdateLevel: () => ProgramUpdateLevel,
|
|
148
148
|
QuotePreference: () => QuotePreference,
|
|
149
|
-
RegularExpressionFlags: () => RegularExpressionFlags,
|
|
150
149
|
RelationComparisonResult: () => RelationComparisonResult,
|
|
151
150
|
Rename: () => ts_Rename_exports,
|
|
152
151
|
ScriptElementKind: () => ScriptElementKind,
|
|
@@ -272,7 +271,6 @@ __export(server_exports, {
|
|
|
272
271
|
changeExtension: () => changeExtension,
|
|
273
272
|
changesAffectModuleResolution: () => changesAffectModuleResolution,
|
|
274
273
|
changesAffectingProgramStructure: () => changesAffectingProgramStructure,
|
|
275
|
-
characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
|
|
276
274
|
childIsDecorated: () => childIsDecorated,
|
|
277
275
|
classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
|
|
278
276
|
classHasClassThisAssignment: () => classHasClassThisAssignment,
|
|
@@ -2038,7 +2036,6 @@ __export(server_exports, {
|
|
|
2038
2036
|
reducePathComponents: () => reducePathComponents,
|
|
2039
2037
|
refactor: () => ts_refactor_exports,
|
|
2040
2038
|
regExpEscape: () => regExpEscape,
|
|
2041
|
-
regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
|
|
2042
2039
|
relativeComplement: () => relativeComplement,
|
|
2043
2040
|
removeAllComments: () => removeAllComments,
|
|
2044
2041
|
removeEmitHelper: () => removeEmitHelper,
|
|
@@ -2333,7 +2330,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2333
2330
|
|
|
2334
2331
|
// src/compiler/corePublic.ts
|
|
2335
2332
|
var versionMajorMinor = "5.4";
|
|
2336
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2333
|
+
var version = `${versionMajorMinor}.0-insiders.20231108`;
|
|
2337
2334
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2338
2335
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2339
2336
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6258,20 +6255,6 @@ var GeneratedIdentifierFlags = /* @__PURE__ */ ((GeneratedIdentifierFlags2) => {
|
|
|
6258
6255
|
GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution";
|
|
6259
6256
|
return GeneratedIdentifierFlags2;
|
|
6260
6257
|
})(GeneratedIdentifierFlags || {});
|
|
6261
|
-
var RegularExpressionFlags = /* @__PURE__ */ ((RegularExpressionFlags2) => {
|
|
6262
|
-
RegularExpressionFlags2[RegularExpressionFlags2["None"] = 0] = "None";
|
|
6263
|
-
RegularExpressionFlags2[RegularExpressionFlags2["HasIndices"] = 1] = "HasIndices";
|
|
6264
|
-
RegularExpressionFlags2[RegularExpressionFlags2["Global"] = 2] = "Global";
|
|
6265
|
-
RegularExpressionFlags2[RegularExpressionFlags2["IgnoreCase"] = 4] = "IgnoreCase";
|
|
6266
|
-
RegularExpressionFlags2[RegularExpressionFlags2["Multiline"] = 8] = "Multiline";
|
|
6267
|
-
RegularExpressionFlags2[RegularExpressionFlags2["DotAll"] = 16] = "DotAll";
|
|
6268
|
-
RegularExpressionFlags2[RegularExpressionFlags2["Unicode"] = 32] = "Unicode";
|
|
6269
|
-
RegularExpressionFlags2[RegularExpressionFlags2["UnicodeSets"] = 64] = "UnicodeSets";
|
|
6270
|
-
RegularExpressionFlags2[RegularExpressionFlags2["Sticky"] = 128] = "Sticky";
|
|
6271
|
-
RegularExpressionFlags2[RegularExpressionFlags2["UnicodeMode"] = 96] = "UnicodeMode";
|
|
6272
|
-
RegularExpressionFlags2[RegularExpressionFlags2["Modifiers"] = 28] = "Modifiers";
|
|
6273
|
-
return RegularExpressionFlags2;
|
|
6274
|
-
})(RegularExpressionFlags || {});
|
|
6275
6258
|
var TokenFlags = /* @__PURE__ */ ((TokenFlags2) => {
|
|
6276
6259
|
TokenFlags2[TokenFlags2["None"] = 0] = "None";
|
|
6277
6260
|
TokenFlags2[TokenFlags2["PrecedingLineBreak"] = 1] = "PrecedingLineBreak";
|
|
@@ -6419,6 +6402,7 @@ var TypeFormatFlags = /* @__PURE__ */ ((TypeFormatFlags2) => {
|
|
|
6419
6402
|
TypeFormatFlags2[TypeFormatFlags2["None"] = 0] = "None";
|
|
6420
6403
|
TypeFormatFlags2[TypeFormatFlags2["NoTruncation"] = 1] = "NoTruncation";
|
|
6421
6404
|
TypeFormatFlags2[TypeFormatFlags2["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType";
|
|
6405
|
+
TypeFormatFlags2[TypeFormatFlags2["GenerateNamesForShadowedTypeParams"] = 4] = "GenerateNamesForShadowedTypeParams";
|
|
6422
6406
|
TypeFormatFlags2[TypeFormatFlags2["UseStructuralFallback"] = 8] = "UseStructuralFallback";
|
|
6423
6407
|
TypeFormatFlags2[TypeFormatFlags2["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature";
|
|
6424
6408
|
TypeFormatFlags2[TypeFormatFlags2["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType";
|
|
@@ -6438,7 +6422,7 @@ var TypeFormatFlags = /* @__PURE__ */ ((TypeFormatFlags2) => {
|
|
|
6438
6422
|
TypeFormatFlags2[TypeFormatFlags2["InElementType"] = 2097152] = "InElementType";
|
|
6439
6423
|
TypeFormatFlags2[TypeFormatFlags2["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument";
|
|
6440
6424
|
TypeFormatFlags2[TypeFormatFlags2["InTypeAlias"] = 8388608] = "InTypeAlias";
|
|
6441
|
-
TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] =
|
|
6425
|
+
TypeFormatFlags2[TypeFormatFlags2["NodeBuilderFlagsMask"] = 848330095] = "NodeBuilderFlagsMask";
|
|
6442
6426
|
return TypeFormatFlags2;
|
|
6443
6427
|
})(TypeFormatFlags || {});
|
|
6444
6428
|
var SymbolFormatFlags = /* @__PURE__ */ ((SymbolFormatFlags2) => {
|
|
@@ -6603,6 +6587,7 @@ var InternalSymbolName = /* @__PURE__ */ ((InternalSymbolName2) => {
|
|
|
6603
6587
|
InternalSymbolName2["ExportEquals"] = "export=";
|
|
6604
6588
|
InternalSymbolName2["Default"] = "default";
|
|
6605
6589
|
InternalSymbolName2["This"] = "this";
|
|
6590
|
+
InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression";
|
|
6606
6591
|
return InternalSymbolName2;
|
|
6607
6592
|
})(InternalSymbolName || {});
|
|
6608
6593
|
var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
|
|
@@ -6980,8 +6965,6 @@ var ScriptTarget = /* @__PURE__ */ ((ScriptTarget11) => {
|
|
|
6980
6965
|
ScriptTarget11[ScriptTarget11["ES2020"] = 7] = "ES2020";
|
|
6981
6966
|
ScriptTarget11[ScriptTarget11["ES2021"] = 8] = "ES2021";
|
|
6982
6967
|
ScriptTarget11[ScriptTarget11["ES2022"] = 9] = "ES2022";
|
|
6983
|
-
ScriptTarget11[ScriptTarget11["ES2023"] = 10] = "ES2023";
|
|
6984
|
-
ScriptTarget11[ScriptTarget11["ES2024"] = 11] = "ES2024";
|
|
6985
6968
|
ScriptTarget11[ScriptTarget11["ESNext"] = 99] = "ESNext";
|
|
6986
6969
|
ScriptTarget11[ScriptTarget11["JSON"] = 100] = "JSON";
|
|
6987
6970
|
ScriptTarget11[ScriptTarget11["Latest"] = 99 /* ESNext */] = "Latest";
|
|
@@ -9656,43 +9639,6 @@ var Diagnostics = {
|
|
|
9656
9639
|
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."),
|
|
9657
9640
|
_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."),
|
|
9658
9641
|
Identifier_string_literal_or_number_literal_expected: diag(1496, 1 /* Error */, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal, or number literal expected."),
|
|
9659
|
-
Unknown_regular_expression_flag: diag(1497, 1 /* Error */, "Unknown_regular_expression_flag_1497", "Unknown regular expression flag."),
|
|
9660
|
-
Duplicate_regular_expression_flag: diag(1498, 1 /* Error */, "Duplicate_regular_expression_flag_1498", "Duplicate regular expression flag."),
|
|
9661
|
-
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."),
|
|
9662
|
-
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."),
|
|
9663
|
-
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."),
|
|
9664
|
-
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."),
|
|
9665
|
-
Incomplete_quantifier_Digit_expected: diag(1503, 1 /* Error */, "Incomplete_quantifier_Digit_expected_1503", "Incomplete quantifier. Digit expected."),
|
|
9666
|
-
Numbers_out_of_order_in_quantifier: diag(1504, 1 /* Error */, "Numbers_out_of_order_in_quantifier_1504", "Numbers out of order in quantifier."),
|
|
9667
|
-
There_is_nothing_available_for_repetition: diag(1505, 1 /* Error */, "There_is_nothing_available_for_repetition_1505", "There is nothing available for repetition."),
|
|
9668
|
-
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?"),
|
|
9669
|
-
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."),
|
|
9670
|
-
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."),
|
|
9671
|
-
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."),
|
|
9672
|
-
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."),
|
|
9673
|
-
Undetermined_character_escape: diag(1511, 1 /* Error */, "Undetermined_character_escape_1511", "Undetermined character escape."),
|
|
9674
|
-
Expected_a_capturing_group_name: diag(1512, 1 /* Error */, "Expected_a_capturing_group_name_1512", "Expected a capturing group name."),
|
|
9675
|
-
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."),
|
|
9676
|
-
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."),
|
|
9677
|
-
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."),
|
|
9678
|
-
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."),
|
|
9679
|
-
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."),
|
|
9680
|
-
Expected_a_class_set_oprand: diag(1518, 1 /* Error */, "Expected_a_class_set_oprand_1518", "Expected a class set oprand."),
|
|
9681
|
-
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."),
|
|
9682
|
-
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?"),
|
|
9683
|
-
Expected_a_Unicode_property_name: diag(1521, 1 /* Error */, "Expected_a_Unicode_property_name_1521", "Expected a Unicode property name."),
|
|
9684
|
-
Unknown_Unicode_property_name: diag(1522, 1 /* Error */, "Unknown_Unicode_property_name_1522", "Unknown Unicode property name."),
|
|
9685
|
-
Expected_a_Unicode_property_value: diag(1523, 1 /* Error */, "Expected_a_Unicode_property_value_1523", "Expected a Unicode property value."),
|
|
9686
|
-
Unknown_Unicode_property_value: diag(1524, 1 /* Error */, "Unknown_Unicode_property_value_1524", "Unknown Unicode property value."),
|
|
9687
|
-
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."),
|
|
9688
|
-
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."),
|
|
9689
|
-
Unknown_Unicode_property_name_or_value: diag(1527, 1 /* Error */, "Unknown_Unicode_property_name_or_value_1527", "Unknown Unicode property name or value."),
|
|
9690
|
-
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."),
|
|
9691
|
-
_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."),
|
|
9692
|
-
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."),
|
|
9693
|
-
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."),
|
|
9694
|
-
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."),
|
|
9695
|
-
_0_is_not_a_valid_character_escape: diag(1533, 1 /* Error */, "_0_is_not_a_valid_character_escape_1533", "'\\{0}' is not a valid character escape."),
|
|
9696
9642
|
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."),
|
|
9697
9643
|
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."),
|
|
9698
9644
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -11535,26 +11481,6 @@ var textToToken = new Map(Object.entries({
|
|
|
11535
11481
|
"#": 63 /* HashToken */,
|
|
11536
11482
|
"`": 62 /* BacktickToken */
|
|
11537
11483
|
}));
|
|
11538
|
-
var charToRegExpFlag = new Map(Object.entries({
|
|
11539
|
-
d: 1 /* HasIndices */,
|
|
11540
|
-
g: 2 /* Global */,
|
|
11541
|
-
i: 4 /* IgnoreCase */,
|
|
11542
|
-
m: 8 /* Multiline */,
|
|
11543
|
-
s: 16 /* DotAll */,
|
|
11544
|
-
u: 32 /* Unicode */,
|
|
11545
|
-
v: 64 /* UnicodeSets */,
|
|
11546
|
-
y: 128 /* Sticky */
|
|
11547
|
-
}));
|
|
11548
|
-
var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
|
|
11549
|
-
[1 /* HasIndices */, 9 /* ES2022 */],
|
|
11550
|
-
[2 /* Global */, 0 /* ES3 */],
|
|
11551
|
-
[4 /* IgnoreCase */, 0 /* ES3 */],
|
|
11552
|
-
[8 /* Multiline */, 0 /* ES3 */],
|
|
11553
|
-
[16 /* DotAll */, 5 /* ES2018 */],
|
|
11554
|
-
[32 /* Unicode */, 2 /* ES2015 */],
|
|
11555
|
-
[64 /* UnicodeSets */, 11 /* ES2024 */],
|
|
11556
|
-
[128 /* Sticky */, 2 /* ES2015 */]
|
|
11557
|
-
]);
|
|
11558
11484
|
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];
|
|
11559
11485
|
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];
|
|
11560
11486
|
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];
|
|
@@ -11605,16 +11531,6 @@ function tokenToString(t) {
|
|
|
11605
11531
|
function stringToToken(s) {
|
|
11606
11532
|
return textToToken.get(s);
|
|
11607
11533
|
}
|
|
11608
|
-
var regExpFlagChars = makeReverseMap(charToRegExpFlag);
|
|
11609
|
-
function regularExpressionFlagToCharacter(f) {
|
|
11610
|
-
return regExpFlagChars[f];
|
|
11611
|
-
}
|
|
11612
|
-
function characterToRegularExpressionFlag(c) {
|
|
11613
|
-
return charToRegExpFlag.get(c);
|
|
11614
|
-
}
|
|
11615
|
-
function regularExpressionFlagToFirstAvailableLanguageVersion(f) {
|
|
11616
|
-
return regExpFlagToFirstAvailableLanguageVersion.get(f);
|
|
11617
|
-
}
|
|
11618
11534
|
function computeLineStarts(text) {
|
|
11619
11535
|
const result = [];
|
|
11620
11536
|
let pos = 0;
|
|
@@ -11711,11 +11627,8 @@ function isDigit(ch) {
|
|
|
11711
11627
|
function isHexDigit(ch) {
|
|
11712
11628
|
return isDigit(ch) || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */;
|
|
11713
11629
|
}
|
|
11714
|
-
function
|
|
11715
|
-
return
|
|
11716
|
-
}
|
|
11717
|
-
function isWordCharacter(ch) {
|
|
11718
|
-
return isASCIILetter(ch) || isDigit(ch) || ch === 95 /* _ */;
|
|
11630
|
+
function isCodePoint(code) {
|
|
11631
|
+
return code <= 1114111;
|
|
11719
11632
|
}
|
|
11720
11633
|
function isOctalDigit(ch) {
|
|
11721
11634
|
return ch >= 48 /* _0 */ && ch <= 55 /* _7 */;
|
|
@@ -12054,10 +11967,10 @@ function getShebang(text) {
|
|
|
12054
11967
|
}
|
|
12055
11968
|
}
|
|
12056
11969
|
function isIdentifierStart(ch, languageVersion) {
|
|
12057
|
-
return
|
|
11970
|
+
return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
|
|
12058
11971
|
}
|
|
12059
11972
|
function isIdentifierPart(ch, languageVersion, identifierVariant) {
|
|
12060
|
-
return
|
|
11973
|
+
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
|
|
12061
11974
|
(identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
|
|
12062
11975
|
}
|
|
12063
11976
|
function isIdentifierText(name, languageVersion, identifierVariant) {
|
|
@@ -12378,9 +12291,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12378
12291
|
result += text.substring(start3, pos);
|
|
12379
12292
|
result += scanEscapeSequence(
|
|
12380
12293
|
/*shouldEmitInvalidEscapeError*/
|
|
12381
|
-
true
|
|
12382
|
-
/*isRegularExpression*/
|
|
12383
|
-
false
|
|
12294
|
+
true
|
|
12384
12295
|
);
|
|
12385
12296
|
start3 = pos;
|
|
12386
12297
|
continue;
|
|
@@ -12424,11 +12335,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12424
12335
|
}
|
|
12425
12336
|
if (currChar === 92 /* backslash */) {
|
|
12426
12337
|
contents += text.substring(start3, pos);
|
|
12427
|
-
contents += scanEscapeSequence(
|
|
12428
|
-
shouldEmitInvalidEscapeError,
|
|
12429
|
-
/*isRegularExpression*/
|
|
12430
|
-
false
|
|
12431
|
-
);
|
|
12338
|
+
contents += scanEscapeSequence(shouldEmitInvalidEscapeError);
|
|
12432
12339
|
start3 = pos;
|
|
12433
12340
|
continue;
|
|
12434
12341
|
}
|
|
@@ -12448,7 +12355,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12448
12355
|
tokenValue = contents;
|
|
12449
12356
|
return resultingToken;
|
|
12450
12357
|
}
|
|
12451
|
-
function scanEscapeSequence(shouldEmitInvalidEscapeError
|
|
12358
|
+
function scanEscapeSequence(shouldEmitInvalidEscapeError) {
|
|
12452
12359
|
const start3 = pos;
|
|
12453
12360
|
pos++;
|
|
12454
12361
|
if (pos >= end) {
|
|
@@ -12476,7 +12383,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12476
12383
|
pos++;
|
|
12477
12384
|
}
|
|
12478
12385
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
12479
|
-
if (
|
|
12386
|
+
if (shouldEmitInvalidEscapeError) {
|
|
12480
12387
|
const code = parseInt(text.substring(start3 + 1, pos), 8);
|
|
12481
12388
|
error2(Diagnostics.Octal_escape_sequences_are_not_allowed_Use_the_syntax_0, start3, pos - start3, "\\x" + code.toString(16).padStart(2, "0"));
|
|
12482
12389
|
return String.fromCharCode(code);
|
|
@@ -12485,7 +12392,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12485
12392
|
case 56 /* _8 */:
|
|
12486
12393
|
case 57 /* _9 */:
|
|
12487
12394
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
12488
|
-
if (
|
|
12395
|
+
if (shouldEmitInvalidEscapeError) {
|
|
12489
12396
|
error2(Diagnostics.Escape_sequence_0_is_not_allowed, start3, pos - start3, text.substring(start3, pos));
|
|
12490
12397
|
return String.fromCharCode(ch);
|
|
12491
12398
|
}
|
|
@@ -12507,42 +12414,62 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12507
12414
|
case 34 /* doubleQuote */:
|
|
12508
12415
|
return '"';
|
|
12509
12416
|
case 117 /* u */:
|
|
12510
|
-
if (
|
|
12511
|
-
pos
|
|
12512
|
-
|
|
12417
|
+
if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) {
|
|
12418
|
+
pos++;
|
|
12419
|
+
const escapedValueString = scanMinimumNumberOfHexDigits(
|
|
12420
|
+
1,
|
|
12421
|
+
/*canHaveSeparators*/
|
|
12422
|
+
false
|
|
12423
|
+
);
|
|
12424
|
+
const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
|
|
12425
|
+
if (escapedValue < 0) {
|
|
12426
|
+
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
12427
|
+
if (shouldEmitInvalidEscapeError) {
|
|
12428
|
+
error2(Diagnostics.Hexadecimal_digit_expected);
|
|
12429
|
+
}
|
|
12430
|
+
return text.substring(start3, pos);
|
|
12431
|
+
}
|
|
12432
|
+
if (!isCodePoint(escapedValue)) {
|
|
12433
|
+
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
12434
|
+
if (shouldEmitInvalidEscapeError) {
|
|
12435
|
+
error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
|
|
12436
|
+
}
|
|
12437
|
+
return text.substring(start3, pos);
|
|
12438
|
+
}
|
|
12439
|
+
if (pos >= end) {
|
|
12440
|
+
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
12441
|
+
if (shouldEmitInvalidEscapeError) {
|
|
12442
|
+
error2(Diagnostics.Unexpected_end_of_text);
|
|
12443
|
+
}
|
|
12444
|
+
return text.substring(start3, pos);
|
|
12445
|
+
}
|
|
12446
|
+
if (text.charCodeAt(pos) !== 125 /* closeBrace */) {
|
|
12447
|
+
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
12448
|
+
if (shouldEmitInvalidEscapeError) {
|
|
12449
|
+
error2(Diagnostics.Unterminated_Unicode_escape_sequence);
|
|
12450
|
+
}
|
|
12451
|
+
return text.substring(start3, pos);
|
|
12452
|
+
}
|
|
12453
|
+
pos++;
|
|
12454
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
12455
|
+
return utf16EncodeAsString(escapedValue);
|
|
12513
12456
|
}
|
|
12514
12457
|
for (; pos < start3 + 6; pos++) {
|
|
12515
12458
|
if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
|
|
12516
12459
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
12517
|
-
if (
|
|
12460
|
+
if (shouldEmitInvalidEscapeError) {
|
|
12518
12461
|
error2(Diagnostics.Hexadecimal_digit_expected);
|
|
12519
12462
|
}
|
|
12520
12463
|
return text.substring(start3, pos);
|
|
12521
12464
|
}
|
|
12522
12465
|
}
|
|
12523
12466
|
tokenFlags |= 1024 /* UnicodeEscape */;
|
|
12524
|
-
|
|
12525
|
-
const escapedValueString = String.fromCharCode(escapedValue);
|
|
12526
|
-
if (isRegularExpression && shouldEmitInvalidEscapeError && escapedValue >= 55296 && escapedValue <= 56319 && pos + 6 < end && text.substring(pos, pos + 2) === "\\u" && text.charCodeAt(pos + 2) !== 123 /* openBrace */) {
|
|
12527
|
-
const nextStart = pos;
|
|
12528
|
-
let nextPos = pos + 2;
|
|
12529
|
-
for (; nextPos < nextStart + 6; nextPos++) {
|
|
12530
|
-
if (!isHexDigit(text.charCodeAt(pos))) {
|
|
12531
|
-
return escapedValueString;
|
|
12532
|
-
}
|
|
12533
|
-
}
|
|
12534
|
-
const nextEscapedValue = parseInt(text.substring(nextStart + 2, nextPos), 16);
|
|
12535
|
-
if (nextEscapedValue >= 56320 && nextEscapedValue <= 57343) {
|
|
12536
|
-
pos = nextPos;
|
|
12537
|
-
return escapedValueString + String.fromCharCode(nextEscapedValue);
|
|
12538
|
-
}
|
|
12539
|
-
}
|
|
12540
|
-
return escapedValueString;
|
|
12467
|
+
return String.fromCharCode(parseInt(text.substring(start3 + 2, pos), 16));
|
|
12541
12468
|
case 120 /* x */:
|
|
12542
12469
|
for (; pos < start3 + 4; pos++) {
|
|
12543
12470
|
if (!(pos < end && isHexDigit(text.charCodeAt(pos)))) {
|
|
12544
12471
|
tokenFlags |= 2048 /* ContainsInvalidEscape */;
|
|
12545
|
-
if (
|
|
12472
|
+
if (shouldEmitInvalidEscapeError) {
|
|
12546
12473
|
error2(Diagnostics.Hexadecimal_digit_expected);
|
|
12547
12474
|
}
|
|
12548
12475
|
return text.substring(start3, pos);
|
|
@@ -12559,16 +12486,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12559
12486
|
case 8233 /* paragraphSeparator */:
|
|
12560
12487
|
return "";
|
|
12561
12488
|
default:
|
|
12562
|
-
if (isRegularExpression && (shouldEmitInvalidEscapeError || isIdentifierPart(ch, languageVersion))) {
|
|
12563
|
-
error2(Diagnostics._0_is_not_a_valid_character_escape, pos - 2, 2, String.fromCharCode(ch));
|
|
12564
|
-
}
|
|
12565
12489
|
return String.fromCharCode(ch);
|
|
12566
12490
|
}
|
|
12567
12491
|
}
|
|
12568
|
-
function scanExtendedUnicodeEscape(
|
|
12569
|
-
const start3 = pos;
|
|
12570
|
-
pos += 3;
|
|
12571
|
-
const escapedStart = pos;
|
|
12492
|
+
function scanExtendedUnicodeEscape() {
|
|
12572
12493
|
const escapedValueString = scanMinimumNumberOfHexDigits(
|
|
12573
12494
|
1,
|
|
12574
12495
|
/*canHaveSeparators*/
|
|
@@ -12577,34 +12498,24 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12577
12498
|
const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1;
|
|
12578
12499
|
let isInvalidExtendedEscape = false;
|
|
12579
12500
|
if (escapedValue < 0) {
|
|
12580
|
-
|
|
12581
|
-
error2(Diagnostics.Hexadecimal_digit_expected);
|
|
12582
|
-
}
|
|
12501
|
+
error2(Diagnostics.Hexadecimal_digit_expected);
|
|
12583
12502
|
isInvalidExtendedEscape = true;
|
|
12584
12503
|
} else if (escapedValue > 1114111) {
|
|
12585
|
-
|
|
12586
|
-
error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive, escapedStart, pos - escapedStart);
|
|
12587
|
-
}
|
|
12504
|
+
error2(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive);
|
|
12588
12505
|
isInvalidExtendedEscape = true;
|
|
12589
12506
|
}
|
|
12590
12507
|
if (pos >= end) {
|
|
12591
|
-
|
|
12592
|
-
error2(Diagnostics.Unexpected_end_of_text);
|
|
12593
|
-
}
|
|
12508
|
+
error2(Diagnostics.Unexpected_end_of_text);
|
|
12594
12509
|
isInvalidExtendedEscape = true;
|
|
12595
12510
|
} else if (text.charCodeAt(pos) === 125 /* closeBrace */) {
|
|
12596
12511
|
pos++;
|
|
12597
12512
|
} else {
|
|
12598
|
-
|
|
12599
|
-
error2(Diagnostics.Unterminated_Unicode_escape_sequence);
|
|
12600
|
-
}
|
|
12513
|
+
error2(Diagnostics.Unterminated_Unicode_escape_sequence);
|
|
12601
12514
|
isInvalidExtendedEscape = true;
|
|
12602
12515
|
}
|
|
12603
12516
|
if (isInvalidExtendedEscape) {
|
|
12604
|
-
|
|
12605
|
-
return text.substring(start3, pos);
|
|
12517
|
+
return "";
|
|
12606
12518
|
}
|
|
12607
|
-
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
12608
12519
|
return utf16EncodeAsString(escapedValue);
|
|
12609
12520
|
}
|
|
12610
12521
|
function peekUnicodeEscape() {
|
|
@@ -12646,6 +12557,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12646
12557
|
} else if (ch === 92 /* backslash */) {
|
|
12647
12558
|
ch = peekExtendedUnicodeEscape();
|
|
12648
12559
|
if (ch >= 0 && isIdentifierPart(ch, languageVersion)) {
|
|
12560
|
+
pos += 3;
|
|
12561
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
12649
12562
|
result += scanExtendedUnicodeEscape();
|
|
12650
12563
|
start3 = pos;
|
|
12651
12564
|
continue;
|
|
@@ -13116,6 +13029,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13116
13029
|
case 92 /* backslash */:
|
|
13117
13030
|
const extendedCookedChar = peekExtendedUnicodeEscape();
|
|
13118
13031
|
if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
|
|
13032
|
+
pos += 3;
|
|
13033
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
13119
13034
|
tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
13120
13035
|
return token = getIdentifierToken();
|
|
13121
13036
|
}
|
|
@@ -13131,7 +13046,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13131
13046
|
return token = 0 /* Unknown */;
|
|
13132
13047
|
case 35 /* hash */:
|
|
13133
13048
|
if (pos !== 0 && text[pos + 1] === "!") {
|
|
13134
|
-
error2(Diagnostics.can_only_be_used_at_the_start_of_a_file
|
|
13049
|
+
error2(Diagnostics.can_only_be_used_at_the_start_of_a_file);
|
|
13135
13050
|
pos++;
|
|
13136
13051
|
return token = 0 /* Unknown */;
|
|
13137
13052
|
}
|
|
@@ -13140,6 +13055,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13140
13055
|
pos++;
|
|
13141
13056
|
const extendedCookedChar2 = peekExtendedUnicodeEscape();
|
|
13142
13057
|
if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) {
|
|
13058
|
+
pos += 3;
|
|
13059
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
13143
13060
|
tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
13144
13061
|
return token = 81 /* PrivateIdentifier */;
|
|
13145
13062
|
}
|
|
@@ -13277,841 +13194,14 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13277
13194
|
}
|
|
13278
13195
|
p++;
|
|
13279
13196
|
}
|
|
13280
|
-
|
|
13281
|
-
const endOfBody = p - (isUnterminated ? 0 : 1);
|
|
13282
|
-
let regExpFlags = 0 /* None */;
|
|
13283
|
-
while (p < end) {
|
|
13284
|
-
const ch = text.charCodeAt(p);
|
|
13285
|
-
if (!isIdentifierPart(ch, languageVersion)) {
|
|
13286
|
-
break;
|
|
13287
|
-
}
|
|
13288
|
-
const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
|
|
13289
|
-
if (flag === void 0) {
|
|
13290
|
-
error2(Diagnostics.Unknown_regular_expression_flag, p, 1);
|
|
13291
|
-
} else if (regExpFlags & flag) {
|
|
13292
|
-
error2(Diagnostics.Duplicate_regular_expression_flag, p, 1);
|
|
13293
|
-
} else if (((regExpFlags | flag) & 96 /* UnicodeMode */) === 96 /* UnicodeMode */) {
|
|
13294
|
-
error2(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, p, 1);
|
|
13295
|
-
} else {
|
|
13296
|
-
regExpFlags |= flag;
|
|
13297
|
-
const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
|
|
13298
|
-
if (languageVersion < availableFrom) {
|
|
13299
|
-
error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, p, 1, ScriptTarget[availableFrom]);
|
|
13300
|
-
}
|
|
13301
|
-
}
|
|
13197
|
+
while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) {
|
|
13302
13198
|
p++;
|
|
13303
13199
|
}
|
|
13304
|
-
pos =
|
|
13305
|
-
const saveTokenPos = tokenStart;
|
|
13306
|
-
const saveTokenFlags = tokenFlags;
|
|
13307
|
-
scanRegularExpressionWorker(text.slice(0, endOfBody), endOfBody, regExpFlags, isUnterminated);
|
|
13308
|
-
if (!isUnterminated) {
|
|
13309
|
-
pos = p;
|
|
13310
|
-
}
|
|
13311
|
-
tokenStart = saveTokenPos;
|
|
13312
|
-
tokenFlags = saveTokenFlags;
|
|
13200
|
+
pos = p;
|
|
13313
13201
|
tokenValue = text.substring(tokenStart, pos);
|
|
13314
13202
|
token = 14 /* RegularExpressionLiteral */;
|
|
13315
13203
|
}
|
|
13316
13204
|
return token;
|
|
13317
|
-
function scanRegularExpressionWorker(text2, end2, regExpFlags, isUnterminated) {
|
|
13318
|
-
const unicodeMode = !!(regExpFlags & 96 /* UnicodeMode */);
|
|
13319
|
-
const unicodeSetsMode = !!(regExpFlags & 64 /* UnicodeSets */);
|
|
13320
|
-
let mayContainStrings = false;
|
|
13321
|
-
let numberOfCapturingGroups = 0;
|
|
13322
|
-
const groupSpecifiers = /* @__PURE__ */ new Set();
|
|
13323
|
-
const groupNameReferences = [];
|
|
13324
|
-
const decimalEscapes = [];
|
|
13325
|
-
const namedCapturingGroups = [];
|
|
13326
|
-
function scanDisjunction(isInGroup) {
|
|
13327
|
-
while (true) {
|
|
13328
|
-
namedCapturingGroups.push(/* @__PURE__ */ new Set());
|
|
13329
|
-
scanAlternative(isInGroup);
|
|
13330
|
-
namedCapturingGroups.pop();
|
|
13331
|
-
if (text2.charCodeAt(pos) !== 124 /* bar */) {
|
|
13332
|
-
return;
|
|
13333
|
-
}
|
|
13334
|
-
pos++;
|
|
13335
|
-
}
|
|
13336
|
-
}
|
|
13337
|
-
function scanAlternative(isInGroup) {
|
|
13338
|
-
let isPreviousTermQuantifiable = false;
|
|
13339
|
-
while (pos < end2) {
|
|
13340
|
-
const start3 = pos;
|
|
13341
|
-
const ch = text2.charCodeAt(pos);
|
|
13342
|
-
switch (ch) {
|
|
13343
|
-
case 94 /* caret */:
|
|
13344
|
-
case 36 /* $ */:
|
|
13345
|
-
pos++;
|
|
13346
|
-
isPreviousTermQuantifiable = false;
|
|
13347
|
-
break;
|
|
13348
|
-
case 92 /* backslash */:
|
|
13349
|
-
pos++;
|
|
13350
|
-
switch (text2.charCodeAt(pos)) {
|
|
13351
|
-
case 98 /* b */:
|
|
13352
|
-
case 66 /* B */:
|
|
13353
|
-
pos++;
|
|
13354
|
-
isPreviousTermQuantifiable = false;
|
|
13355
|
-
break;
|
|
13356
|
-
default:
|
|
13357
|
-
scanAtomEscape();
|
|
13358
|
-
isPreviousTermQuantifiable = true;
|
|
13359
|
-
break;
|
|
13360
|
-
}
|
|
13361
|
-
break;
|
|
13362
|
-
case 40 /* openParen */:
|
|
13363
|
-
pos++;
|
|
13364
|
-
if (text2.charCodeAt(pos) === 63 /* question */) {
|
|
13365
|
-
pos++;
|
|
13366
|
-
switch (text2.charCodeAt(pos)) {
|
|
13367
|
-
case 61 /* equals */:
|
|
13368
|
-
case 33 /* exclamation */:
|
|
13369
|
-
pos++;
|
|
13370
|
-
isPreviousTermQuantifiable = false;
|
|
13371
|
-
break;
|
|
13372
|
-
case 60 /* lessThan */:
|
|
13373
|
-
const groupNameStart = pos;
|
|
13374
|
-
pos++;
|
|
13375
|
-
switch (text2.charCodeAt(pos)) {
|
|
13376
|
-
case 61 /* equals */:
|
|
13377
|
-
case 33 /* exclamation */:
|
|
13378
|
-
pos++;
|
|
13379
|
-
isPreviousTermQuantifiable = false;
|
|
13380
|
-
break;
|
|
13381
|
-
default:
|
|
13382
|
-
scanGroupName(
|
|
13383
|
-
/*isReference*/
|
|
13384
|
-
false
|
|
13385
|
-
);
|
|
13386
|
-
scanExpectedChar(62 /* greaterThan */);
|
|
13387
|
-
if (languageVersion < 5 /* ES2018 */) {
|
|
13388
|
-
error2(Diagnostics.Named_capturing_groups_are_only_available_when_targeting_ES2018_or_later, groupNameStart, pos - groupNameStart);
|
|
13389
|
-
}
|
|
13390
|
-
numberOfCapturingGroups++;
|
|
13391
|
-
isPreviousTermQuantifiable = true;
|
|
13392
|
-
break;
|
|
13393
|
-
}
|
|
13394
|
-
break;
|
|
13395
|
-
default:
|
|
13396
|
-
const start4 = pos;
|
|
13397
|
-
const setFlags = scanPatternModifiers();
|
|
13398
|
-
if (text2.charCodeAt(pos) === 45 /* minus */) {
|
|
13399
|
-
pos++;
|
|
13400
|
-
scanPatternModifiers(setFlags);
|
|
13401
|
-
if (pos === start4 + 1) {
|
|
13402
|
-
error2(Diagnostics.Subpattern_flags_must_be_present_when_there_is_a_minus_sign, start4, pos - start4);
|
|
13403
|
-
}
|
|
13404
|
-
}
|
|
13405
|
-
scanExpectedChar(58 /* colon */);
|
|
13406
|
-
isPreviousTermQuantifiable = true;
|
|
13407
|
-
break;
|
|
13408
|
-
}
|
|
13409
|
-
} else {
|
|
13410
|
-
numberOfCapturingGroups++;
|
|
13411
|
-
isPreviousTermQuantifiable = true;
|
|
13412
|
-
}
|
|
13413
|
-
scanDisjunction(
|
|
13414
|
-
/*isInGroup*/
|
|
13415
|
-
true
|
|
13416
|
-
);
|
|
13417
|
-
scanExpectedChar(41 /* closeParen */);
|
|
13418
|
-
break;
|
|
13419
|
-
case 123 /* openBrace */:
|
|
13420
|
-
pos++;
|
|
13421
|
-
const digitsStart = pos;
|
|
13422
|
-
scanDigits();
|
|
13423
|
-
const min2 = tokenValue;
|
|
13424
|
-
if (text2.charCodeAt(pos) === 44 /* comma */) {
|
|
13425
|
-
pos++;
|
|
13426
|
-
scanDigits();
|
|
13427
|
-
const max = tokenValue;
|
|
13428
|
-
if (!min2) {
|
|
13429
|
-
if (max || text2.charCodeAt(pos) === 125 /* closeBrace */) {
|
|
13430
|
-
error2(Diagnostics.Incomplete_quantifier_Digit_expected, digitsStart, 0);
|
|
13431
|
-
} else {
|
|
13432
|
-
if (unicodeMode) {
|
|
13433
|
-
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start3, 1, String.fromCharCode(ch));
|
|
13434
|
-
}
|
|
13435
|
-
isPreviousTermQuantifiable = true;
|
|
13436
|
-
break;
|
|
13437
|
-
}
|
|
13438
|
-
}
|
|
13439
|
-
if (max && Number.parseInt(min2) > Number.parseInt(max)) {
|
|
13440
|
-
error2(Diagnostics.Numbers_out_of_order_in_quantifier, digitsStart, pos - digitsStart);
|
|
13441
|
-
}
|
|
13442
|
-
} else if (!min2) {
|
|
13443
|
-
if (unicodeMode) {
|
|
13444
|
-
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, start3, 1, String.fromCharCode(ch));
|
|
13445
|
-
}
|
|
13446
|
-
isPreviousTermQuantifiable = true;
|
|
13447
|
-
break;
|
|
13448
|
-
}
|
|
13449
|
-
scanExpectedChar(125 /* closeBrace */);
|
|
13450
|
-
pos--;
|
|
13451
|
-
case 42 /* asterisk */:
|
|
13452
|
-
case 43 /* plus */:
|
|
13453
|
-
case 63 /* question */:
|
|
13454
|
-
pos++;
|
|
13455
|
-
if (text2.charCodeAt(pos) === 63 /* question */) {
|
|
13456
|
-
pos++;
|
|
13457
|
-
}
|
|
13458
|
-
if (!isPreviousTermQuantifiable) {
|
|
13459
|
-
error2(Diagnostics.There_is_nothing_available_for_repetition, start3, pos - start3);
|
|
13460
|
-
}
|
|
13461
|
-
isPreviousTermQuantifiable = false;
|
|
13462
|
-
break;
|
|
13463
|
-
case 46 /* dot */:
|
|
13464
|
-
pos++;
|
|
13465
|
-
isPreviousTermQuantifiable = true;
|
|
13466
|
-
break;
|
|
13467
|
-
case 91 /* openBracket */:
|
|
13468
|
-
pos++;
|
|
13469
|
-
if (unicodeSetsMode) {
|
|
13470
|
-
scanClassSetExpression();
|
|
13471
|
-
} else {
|
|
13472
|
-
scanClassRanges();
|
|
13473
|
-
}
|
|
13474
|
-
scanExpectedChar(93 /* closeBracket */);
|
|
13475
|
-
isPreviousTermQuantifiable = true;
|
|
13476
|
-
break;
|
|
13477
|
-
case 41 /* closeParen */:
|
|
13478
|
-
if (isInGroup) {
|
|
13479
|
-
return;
|
|
13480
|
-
}
|
|
13481
|
-
case 93 /* closeBracket */:
|
|
13482
|
-
case 125 /* closeBrace */:
|
|
13483
|
-
if (isUnterminated && !isInGroup) {
|
|
13484
|
-
return;
|
|
13485
|
-
}
|
|
13486
|
-
if (unicodeMode) {
|
|
13487
|
-
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
13488
|
-
}
|
|
13489
|
-
pos++;
|
|
13490
|
-
isPreviousTermQuantifiable = true;
|
|
13491
|
-
break;
|
|
13492
|
-
case 47 /* slash */:
|
|
13493
|
-
case 124 /* bar */:
|
|
13494
|
-
return;
|
|
13495
|
-
default:
|
|
13496
|
-
scanSourceCharacter();
|
|
13497
|
-
isPreviousTermQuantifiable = true;
|
|
13498
|
-
break;
|
|
13499
|
-
}
|
|
13500
|
-
}
|
|
13501
|
-
}
|
|
13502
|
-
function scanPatternModifiers(currFlags = 0 /* None */) {
|
|
13503
|
-
while (pos < end2) {
|
|
13504
|
-
const ch = text2.charCodeAt(pos);
|
|
13505
|
-
if (!isIdentifierPart(ch, languageVersion)) {
|
|
13506
|
-
break;
|
|
13507
|
-
}
|
|
13508
|
-
const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
|
|
13509
|
-
if (flag === void 0) {
|
|
13510
|
-
error2(Diagnostics.Unknown_regular_expression_flag, pos, 1);
|
|
13511
|
-
} else if (currFlags & flag) {
|
|
13512
|
-
error2(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
|
|
13513
|
-
} else if (!(flag & 28 /* Modifiers */)) {
|
|
13514
|
-
error2(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, 1);
|
|
13515
|
-
} else {
|
|
13516
|
-
currFlags |= flag;
|
|
13517
|
-
const availableFrom = regularExpressionFlagToFirstAvailableLanguageVersion(flag);
|
|
13518
|
-
if (languageVersion < availableFrom) {
|
|
13519
|
-
error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, 1, ScriptTarget[availableFrom]);
|
|
13520
|
-
}
|
|
13521
|
-
}
|
|
13522
|
-
pos++;
|
|
13523
|
-
}
|
|
13524
|
-
return currFlags;
|
|
13525
|
-
}
|
|
13526
|
-
function scanAtomEscape() {
|
|
13527
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
13528
|
-
switch (text2.charCodeAt(pos)) {
|
|
13529
|
-
case 107 /* k */:
|
|
13530
|
-
pos++;
|
|
13531
|
-
if (text2.charCodeAt(pos) === 60 /* lessThan */) {
|
|
13532
|
-
pos++;
|
|
13533
|
-
scanGroupName(
|
|
13534
|
-
/*isReference*/
|
|
13535
|
-
true
|
|
13536
|
-
);
|
|
13537
|
-
scanExpectedChar(62 /* greaterThan */);
|
|
13538
|
-
} else if (unicodeMode) {
|
|
13539
|
-
error2(Diagnostics.k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets, pos - 2, 2);
|
|
13540
|
-
}
|
|
13541
|
-
break;
|
|
13542
|
-
case 113 /* q */:
|
|
13543
|
-
if (unicodeSetsMode) {
|
|
13544
|
-
pos++;
|
|
13545
|
-
error2(Diagnostics.q_is_only_available_inside_character_class, pos - 2, 2);
|
|
13546
|
-
break;
|
|
13547
|
-
}
|
|
13548
|
-
default:
|
|
13549
|
-
scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape();
|
|
13550
|
-
break;
|
|
13551
|
-
}
|
|
13552
|
-
}
|
|
13553
|
-
function scanDecimalEscape() {
|
|
13554
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
13555
|
-
const ch = text2.charCodeAt(pos);
|
|
13556
|
-
if (ch >= 49 /* _1 */ && ch <= 57 /* _9 */) {
|
|
13557
|
-
const start3 = pos;
|
|
13558
|
-
scanDigits();
|
|
13559
|
-
decimalEscapes.push({ pos: start3, end: pos, value: +tokenValue });
|
|
13560
|
-
return true;
|
|
13561
|
-
}
|
|
13562
|
-
return false;
|
|
13563
|
-
}
|
|
13564
|
-
function scanCharacterEscape() {
|
|
13565
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
13566
|
-
let ch = text2.charCodeAt(pos);
|
|
13567
|
-
switch (ch) {
|
|
13568
|
-
case 99 /* c */:
|
|
13569
|
-
pos++;
|
|
13570
|
-
ch = text2.charCodeAt(pos);
|
|
13571
|
-
if (isASCIILetter(ch)) {
|
|
13572
|
-
pos++;
|
|
13573
|
-
return String.fromCharCode(ch & 31);
|
|
13574
|
-
}
|
|
13575
|
-
if (unicodeMode) {
|
|
13576
|
-
error2(Diagnostics.c_must_be_followed_by_an_ASCII_letter, pos - 2, 2);
|
|
13577
|
-
}
|
|
13578
|
-
return String.fromCharCode(ch);
|
|
13579
|
-
case 94 /* caret */:
|
|
13580
|
-
case 36 /* $ */:
|
|
13581
|
-
case 47 /* slash */:
|
|
13582
|
-
case 92 /* backslash */:
|
|
13583
|
-
case 46 /* dot */:
|
|
13584
|
-
case 42 /* asterisk */:
|
|
13585
|
-
case 43 /* plus */:
|
|
13586
|
-
case 63 /* question */:
|
|
13587
|
-
case 40 /* openParen */:
|
|
13588
|
-
case 41 /* closeParen */:
|
|
13589
|
-
case 91 /* openBracket */:
|
|
13590
|
-
case 93 /* closeBracket */:
|
|
13591
|
-
case 123 /* openBrace */:
|
|
13592
|
-
case 125 /* closeBrace */:
|
|
13593
|
-
case 124 /* bar */:
|
|
13594
|
-
pos++;
|
|
13595
|
-
return String.fromCharCode(ch);
|
|
13596
|
-
default:
|
|
13597
|
-
if (pos >= end2) {
|
|
13598
|
-
error2(Diagnostics.Undetermined_character_escape, pos - 1, 1, ch);
|
|
13599
|
-
return "\\";
|
|
13600
|
-
}
|
|
13601
|
-
pos--;
|
|
13602
|
-
return scanEscapeSequence(
|
|
13603
|
-
/*shouldEmitInvalidEscapeError*/
|
|
13604
|
-
unicodeMode,
|
|
13605
|
-
/*isRegularExpression*/
|
|
13606
|
-
true
|
|
13607
|
-
);
|
|
13608
|
-
}
|
|
13609
|
-
}
|
|
13610
|
-
function scanGroupName(isReference) {
|
|
13611
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 60 /* lessThan */);
|
|
13612
|
-
tokenStart = pos;
|
|
13613
|
-
scanIdentifier(codePointAt(text2, pos), languageVersion);
|
|
13614
|
-
if (pos === tokenStart) {
|
|
13615
|
-
error2(Diagnostics.Expected_a_capturing_group_name);
|
|
13616
|
-
} else if (isReference) {
|
|
13617
|
-
groupNameReferences.push({ pos: tokenStart, end: pos, name: tokenValue });
|
|
13618
|
-
} else if (namedCapturingGroups.some((group2) => group2.has(tokenValue))) {
|
|
13619
|
-
error2(Diagnostics.Named_capturing_groups_with_the_same_name_must_be_mutually_exclusive_to_each_other, tokenStart, pos - tokenStart);
|
|
13620
|
-
} else {
|
|
13621
|
-
last(namedCapturingGroups).add(tokenValue);
|
|
13622
|
-
groupSpecifiers.add(tokenValue);
|
|
13623
|
-
}
|
|
13624
|
-
}
|
|
13625
|
-
function isClassContentExit(ch) {
|
|
13626
|
-
return ch === 93 /* closeBracket */ || pos >= end2;
|
|
13627
|
-
}
|
|
13628
|
-
function scanClassRanges() {
|
|
13629
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
|
|
13630
|
-
if (text2.charCodeAt(pos) === 94 /* caret */) {
|
|
13631
|
-
pos++;
|
|
13632
|
-
}
|
|
13633
|
-
while (pos < end2) {
|
|
13634
|
-
const ch = text2.charCodeAt(pos);
|
|
13635
|
-
if (isClassContentExit(ch)) {
|
|
13636
|
-
return;
|
|
13637
|
-
}
|
|
13638
|
-
const minStart = pos;
|
|
13639
|
-
const minCharacter = scanClassAtom();
|
|
13640
|
-
if (text2.charCodeAt(pos) === 45 /* minus */) {
|
|
13641
|
-
pos++;
|
|
13642
|
-
const ch2 = text2.charCodeAt(pos);
|
|
13643
|
-
if (isClassContentExit(ch2)) {
|
|
13644
|
-
return;
|
|
13645
|
-
}
|
|
13646
|
-
if (!minCharacter) {
|
|
13647
|
-
error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, minStart, pos - 1 - minStart);
|
|
13648
|
-
}
|
|
13649
|
-
const maxStart = pos;
|
|
13650
|
-
const maxCharacter = scanClassAtom();
|
|
13651
|
-
if (!maxCharacter) {
|
|
13652
|
-
error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, maxStart, pos - maxStart);
|
|
13653
|
-
continue;
|
|
13654
|
-
}
|
|
13655
|
-
if (!minCharacter) {
|
|
13656
|
-
continue;
|
|
13657
|
-
}
|
|
13658
|
-
const minCharacterValue = codePointAt(minCharacter, 0);
|
|
13659
|
-
const maxCharacterValue = codePointAt(maxCharacter, 0);
|
|
13660
|
-
if (minCharacter.length === charSize(minCharacterValue) && maxCharacter.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
|
|
13661
|
-
error2(Diagnostics.Range_out_of_order_in_character_class, minStart, pos - minStart);
|
|
13662
|
-
}
|
|
13663
|
-
}
|
|
13664
|
-
}
|
|
13665
|
-
}
|
|
13666
|
-
function scanClassSetExpression() {
|
|
13667
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 91 /* openBracket */);
|
|
13668
|
-
let isCharacterComplement = false;
|
|
13669
|
-
if (text2.charCodeAt(pos) === 94 /* caret */) {
|
|
13670
|
-
pos++;
|
|
13671
|
-
isCharacterComplement = true;
|
|
13672
|
-
}
|
|
13673
|
-
let expressionMayContainStrings = false;
|
|
13674
|
-
let ch = text2.charCodeAt(pos);
|
|
13675
|
-
if (isClassContentExit(ch)) {
|
|
13676
|
-
return;
|
|
13677
|
-
}
|
|
13678
|
-
let start3 = pos;
|
|
13679
|
-
let oprand;
|
|
13680
|
-
switch (text2.slice(pos, pos + 2)) {
|
|
13681
|
-
case "--":
|
|
13682
|
-
case "&&":
|
|
13683
|
-
error2(Diagnostics.Expected_a_class_set_oprand);
|
|
13684
|
-
mayContainStrings = false;
|
|
13685
|
-
break;
|
|
13686
|
-
default:
|
|
13687
|
-
oprand = scanClassSetOprand();
|
|
13688
|
-
break;
|
|
13689
|
-
}
|
|
13690
|
-
switch (text2.charCodeAt(pos)) {
|
|
13691
|
-
case 45 /* minus */:
|
|
13692
|
-
if (text2.charCodeAt(pos + 1) === 45 /* minus */) {
|
|
13693
|
-
if (isCharacterComplement && mayContainStrings) {
|
|
13694
|
-
error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start3, pos - start3);
|
|
13695
|
-
}
|
|
13696
|
-
expressionMayContainStrings = mayContainStrings;
|
|
13697
|
-
scanClassSetSubExpression(3 /* ClassSubtraction */);
|
|
13698
|
-
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
13699
|
-
return;
|
|
13700
|
-
}
|
|
13701
|
-
break;
|
|
13702
|
-
case 38 /* ampersand */:
|
|
13703
|
-
if (text2.charCodeAt(pos + 1) === 38 /* ampersand */) {
|
|
13704
|
-
scanClassSetSubExpression(2 /* ClassIntersection */);
|
|
13705
|
-
if (isCharacterComplement && mayContainStrings) {
|
|
13706
|
-
error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start3, pos - start3);
|
|
13707
|
-
}
|
|
13708
|
-
expressionMayContainStrings = mayContainStrings;
|
|
13709
|
-
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
13710
|
-
return;
|
|
13711
|
-
} else {
|
|
13712
|
-
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
13713
|
-
}
|
|
13714
|
-
break;
|
|
13715
|
-
default:
|
|
13716
|
-
if (isCharacterComplement && mayContainStrings) {
|
|
13717
|
-
error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, start3, pos - start3);
|
|
13718
|
-
}
|
|
13719
|
-
expressionMayContainStrings = mayContainStrings;
|
|
13720
|
-
break;
|
|
13721
|
-
}
|
|
13722
|
-
while (pos < end2) {
|
|
13723
|
-
ch = text2.charCodeAt(pos);
|
|
13724
|
-
switch (ch) {
|
|
13725
|
-
case 45 /* minus */:
|
|
13726
|
-
pos++;
|
|
13727
|
-
ch = text2.charCodeAt(pos);
|
|
13728
|
-
if (isClassContentExit(ch)) {
|
|
13729
|
-
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
13730
|
-
return;
|
|
13731
|
-
}
|
|
13732
|
-
if (ch === 45 /* minus */) {
|
|
13733
|
-
pos++;
|
|
13734
|
-
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
13735
|
-
start3 = pos - 2;
|
|
13736
|
-
oprand = text2.slice(start3, pos);
|
|
13737
|
-
continue;
|
|
13738
|
-
} else {
|
|
13739
|
-
if (!oprand) {
|
|
13740
|
-
error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, start3, pos - 1 - start3);
|
|
13741
|
-
}
|
|
13742
|
-
const secondStart = pos;
|
|
13743
|
-
const secondOprand = scanClassSetOprand();
|
|
13744
|
-
if (isCharacterComplement && mayContainStrings) {
|
|
13745
|
-
error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, secondStart, pos - secondStart);
|
|
13746
|
-
}
|
|
13747
|
-
expressionMayContainStrings || (expressionMayContainStrings = mayContainStrings);
|
|
13748
|
-
if (!secondOprand) {
|
|
13749
|
-
error2(Diagnostics.A_character_class_range_must_not_be_bounded_by_another_character_class, secondStart, pos - secondStart);
|
|
13750
|
-
break;
|
|
13751
|
-
}
|
|
13752
|
-
if (!oprand) {
|
|
13753
|
-
break;
|
|
13754
|
-
}
|
|
13755
|
-
const minCharacterValue = codePointAt(oprand, 0);
|
|
13756
|
-
const maxCharacterValue = codePointAt(secondOprand, 0);
|
|
13757
|
-
if (oprand.length === charSize(minCharacterValue) && secondOprand.length === charSize(maxCharacterValue) && minCharacterValue > maxCharacterValue) {
|
|
13758
|
-
error2(Diagnostics.Range_out_of_order_in_character_class, start3, pos - start3);
|
|
13759
|
-
}
|
|
13760
|
-
}
|
|
13761
|
-
break;
|
|
13762
|
-
case 38 /* ampersand */:
|
|
13763
|
-
start3 = pos;
|
|
13764
|
-
pos++;
|
|
13765
|
-
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
13766
|
-
pos++;
|
|
13767
|
-
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
13768
|
-
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
13769
|
-
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
13770
|
-
pos++;
|
|
13771
|
-
}
|
|
13772
|
-
} else {
|
|
13773
|
-
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
|
|
13774
|
-
}
|
|
13775
|
-
oprand = text2.slice(start3, pos);
|
|
13776
|
-
continue;
|
|
13777
|
-
}
|
|
13778
|
-
if (isClassContentExit(text2.charCodeAt(pos))) {
|
|
13779
|
-
break;
|
|
13780
|
-
}
|
|
13781
|
-
start3 = pos;
|
|
13782
|
-
switch (text2.slice(pos, pos + 2)) {
|
|
13783
|
-
case "--":
|
|
13784
|
-
case "&&":
|
|
13785
|
-
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2);
|
|
13786
|
-
pos += 2;
|
|
13787
|
-
oprand = text2.slice(start3, pos);
|
|
13788
|
-
break;
|
|
13789
|
-
default:
|
|
13790
|
-
oprand = scanClassSetOprand();
|
|
13791
|
-
break;
|
|
13792
|
-
}
|
|
13793
|
-
}
|
|
13794
|
-
mayContainStrings = !isCharacterComplement && expressionMayContainStrings;
|
|
13795
|
-
}
|
|
13796
|
-
function scanClassSetSubExpression(expressionType) {
|
|
13797
|
-
let expressionMayContainStrings = mayContainStrings;
|
|
13798
|
-
while (pos < end2) {
|
|
13799
|
-
let ch = text2.charCodeAt(pos);
|
|
13800
|
-
if (isClassContentExit(ch)) {
|
|
13801
|
-
break;
|
|
13802
|
-
}
|
|
13803
|
-
switch (ch) {
|
|
13804
|
-
case 45 /* minus */:
|
|
13805
|
-
pos++;
|
|
13806
|
-
if (text2.charCodeAt(pos) === 45 /* minus */) {
|
|
13807
|
-
pos++;
|
|
13808
|
-
if (expressionType !== 3 /* ClassSubtraction */) {
|
|
13809
|
-
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
13810
|
-
}
|
|
13811
|
-
} else {
|
|
13812
|
-
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 1, 1);
|
|
13813
|
-
}
|
|
13814
|
-
break;
|
|
13815
|
-
case 38 /* ampersand */:
|
|
13816
|
-
pos++;
|
|
13817
|
-
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
13818
|
-
pos++;
|
|
13819
|
-
if (expressionType !== 2 /* ClassIntersection */) {
|
|
13820
|
-
error2(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos - 2, 2);
|
|
13821
|
-
}
|
|
13822
|
-
if (text2.charCodeAt(pos) === 38 /* ampersand */) {
|
|
13823
|
-
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
13824
|
-
pos++;
|
|
13825
|
-
}
|
|
13826
|
-
} else {
|
|
13827
|
-
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos - 1, 1, String.fromCharCode(ch));
|
|
13828
|
-
}
|
|
13829
|
-
break;
|
|
13830
|
-
default:
|
|
13831
|
-
switch (expressionType) {
|
|
13832
|
-
case 3 /* ClassSubtraction */:
|
|
13833
|
-
error2(Diagnostics._0_expected, pos, 0, "--");
|
|
13834
|
-
break;
|
|
13835
|
-
case 2 /* ClassIntersection */:
|
|
13836
|
-
error2(Diagnostics._0_expected, pos, 0, "&&");
|
|
13837
|
-
break;
|
|
13838
|
-
default:
|
|
13839
|
-
break;
|
|
13840
|
-
}
|
|
13841
|
-
break;
|
|
13842
|
-
}
|
|
13843
|
-
ch = text2.charCodeAt(pos);
|
|
13844
|
-
if (isClassContentExit(ch)) {
|
|
13845
|
-
error2(Diagnostics.Expected_a_class_set_oprand);
|
|
13846
|
-
break;
|
|
13847
|
-
}
|
|
13848
|
-
scanClassSetOprand();
|
|
13849
|
-
expressionMayContainStrings && (expressionMayContainStrings = mayContainStrings);
|
|
13850
|
-
}
|
|
13851
|
-
mayContainStrings = expressionMayContainStrings;
|
|
13852
|
-
}
|
|
13853
|
-
function scanClassSetOprand() {
|
|
13854
|
-
mayContainStrings = false;
|
|
13855
|
-
switch (text2.charCodeAt(pos)) {
|
|
13856
|
-
case 91 /* openBracket */:
|
|
13857
|
-
pos++;
|
|
13858
|
-
scanClassSetExpression();
|
|
13859
|
-
scanExpectedChar(93 /* closeBracket */);
|
|
13860
|
-
return "";
|
|
13861
|
-
case 92 /* backslash */:
|
|
13862
|
-
pos++;
|
|
13863
|
-
if (scanCharacterClassEscape()) {
|
|
13864
|
-
return "";
|
|
13865
|
-
} else if (text2.charCodeAt(pos) === 113 /* q */) {
|
|
13866
|
-
pos++;
|
|
13867
|
-
if (text2.charCodeAt(pos) === 123 /* openBrace */) {
|
|
13868
|
-
pos++;
|
|
13869
|
-
scanClassStringDisjunctionContents();
|
|
13870
|
-
scanExpectedChar(125 /* closeBrace */);
|
|
13871
|
-
return "";
|
|
13872
|
-
} else {
|
|
13873
|
-
error2(Diagnostics.q_must_be_followed_by_string_alternatives_enclosed_in_braces, pos - 2, 2);
|
|
13874
|
-
return "q";
|
|
13875
|
-
}
|
|
13876
|
-
}
|
|
13877
|
-
pos--;
|
|
13878
|
-
default:
|
|
13879
|
-
return scanClassSetCharacter();
|
|
13880
|
-
}
|
|
13881
|
-
}
|
|
13882
|
-
function scanClassStringDisjunctionContents() {
|
|
13883
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 123 /* openBrace */);
|
|
13884
|
-
let characterCount = 0;
|
|
13885
|
-
while (pos < end2) {
|
|
13886
|
-
const ch = text2.charCodeAt(pos);
|
|
13887
|
-
switch (ch) {
|
|
13888
|
-
case 125 /* closeBrace */:
|
|
13889
|
-
if (characterCount !== 1) {
|
|
13890
|
-
mayContainStrings = true;
|
|
13891
|
-
}
|
|
13892
|
-
return;
|
|
13893
|
-
case 124 /* bar */:
|
|
13894
|
-
if (characterCount !== 1) {
|
|
13895
|
-
mayContainStrings = true;
|
|
13896
|
-
}
|
|
13897
|
-
pos++;
|
|
13898
|
-
start2 = pos;
|
|
13899
|
-
characterCount = 0;
|
|
13900
|
-
break;
|
|
13901
|
-
default:
|
|
13902
|
-
scanClassSetCharacter();
|
|
13903
|
-
characterCount++;
|
|
13904
|
-
break;
|
|
13905
|
-
}
|
|
13906
|
-
}
|
|
13907
|
-
}
|
|
13908
|
-
function scanClassSetCharacter() {
|
|
13909
|
-
const ch = text2.charCodeAt(pos);
|
|
13910
|
-
if (ch === 92 /* backslash */) {
|
|
13911
|
-
pos++;
|
|
13912
|
-
const ch2 = text2.charCodeAt(pos);
|
|
13913
|
-
switch (ch2) {
|
|
13914
|
-
case 98 /* b */:
|
|
13915
|
-
pos++;
|
|
13916
|
-
return "\b";
|
|
13917
|
-
case 38 /* ampersand */:
|
|
13918
|
-
case 45 /* minus */:
|
|
13919
|
-
case 33 /* exclamation */:
|
|
13920
|
-
case 35 /* hash */:
|
|
13921
|
-
case 37 /* percent */:
|
|
13922
|
-
case 44 /* comma */:
|
|
13923
|
-
case 58 /* colon */:
|
|
13924
|
-
case 59 /* semicolon */:
|
|
13925
|
-
case 60 /* lessThan */:
|
|
13926
|
-
case 61 /* equals */:
|
|
13927
|
-
case 62 /* greaterThan */:
|
|
13928
|
-
case 64 /* at */:
|
|
13929
|
-
case 96 /* backtick */:
|
|
13930
|
-
case 126 /* tilde */:
|
|
13931
|
-
pos++;
|
|
13932
|
-
return String.fromCharCode(ch2);
|
|
13933
|
-
default:
|
|
13934
|
-
return scanCharacterEscape();
|
|
13935
|
-
}
|
|
13936
|
-
} else if (ch === text2.charCodeAt(pos + 1)) {
|
|
13937
|
-
switch (ch) {
|
|
13938
|
-
case 38 /* ampersand */:
|
|
13939
|
-
case 33 /* exclamation */:
|
|
13940
|
-
case 35 /* hash */:
|
|
13941
|
-
case 37 /* percent */:
|
|
13942
|
-
case 42 /* asterisk */:
|
|
13943
|
-
case 43 /* plus */:
|
|
13944
|
-
case 44 /* comma */:
|
|
13945
|
-
case 46 /* dot */:
|
|
13946
|
-
case 58 /* colon */:
|
|
13947
|
-
case 59 /* semicolon */:
|
|
13948
|
-
case 60 /* lessThan */:
|
|
13949
|
-
case 61 /* equals */:
|
|
13950
|
-
case 62 /* greaterThan */:
|
|
13951
|
-
case 63 /* question */:
|
|
13952
|
-
case 64 /* at */:
|
|
13953
|
-
case 96 /* backtick */:
|
|
13954
|
-
case 126 /* tilde */:
|
|
13955
|
-
error2(Diagnostics.A_character_class_must_not_contain_a_reserved_double_punctuator_Did_you_mean_to_escape_it_with_backslash, pos, 2);
|
|
13956
|
-
pos += 2;
|
|
13957
|
-
return text2.substring(pos - 2, pos);
|
|
13958
|
-
}
|
|
13959
|
-
}
|
|
13960
|
-
switch (ch) {
|
|
13961
|
-
case 47 /* slash */:
|
|
13962
|
-
case 40 /* openParen */:
|
|
13963
|
-
case 41 /* closeParen */:
|
|
13964
|
-
case 91 /* openBracket */:
|
|
13965
|
-
case 93 /* closeBracket */:
|
|
13966
|
-
case 123 /* openBrace */:
|
|
13967
|
-
case 125 /* closeBrace */:
|
|
13968
|
-
case 45 /* minus */:
|
|
13969
|
-
case 124 /* bar */:
|
|
13970
|
-
error2(Diagnostics.Unexpected_0_Did_you_mean_to_escape_it_with_backslash, pos, 1, String.fromCharCode(ch));
|
|
13971
|
-
pos++;
|
|
13972
|
-
return String.fromCharCode(ch);
|
|
13973
|
-
}
|
|
13974
|
-
return scanSourceCharacter();
|
|
13975
|
-
}
|
|
13976
|
-
function scanClassAtom() {
|
|
13977
|
-
if (text2.charCodeAt(pos) === 92 /* backslash */) {
|
|
13978
|
-
pos++;
|
|
13979
|
-
const ch = text2.charCodeAt(pos);
|
|
13980
|
-
switch (ch) {
|
|
13981
|
-
case 98 /* b */:
|
|
13982
|
-
pos++;
|
|
13983
|
-
return "\b";
|
|
13984
|
-
case 45 /* minus */:
|
|
13985
|
-
pos++;
|
|
13986
|
-
return String.fromCharCode(ch);
|
|
13987
|
-
default:
|
|
13988
|
-
if (scanCharacterClassEscape()) {
|
|
13989
|
-
return "";
|
|
13990
|
-
}
|
|
13991
|
-
return scanCharacterEscape();
|
|
13992
|
-
}
|
|
13993
|
-
} else {
|
|
13994
|
-
return scanSourceCharacter();
|
|
13995
|
-
}
|
|
13996
|
-
}
|
|
13997
|
-
function scanCharacterClassEscape() {
|
|
13998
|
-
Debug.assertEqual(text2.charCodeAt(pos - 1), 92 /* backslash */);
|
|
13999
|
-
let isCharacterComplement = false;
|
|
14000
|
-
const start3 = pos - 1;
|
|
14001
|
-
const ch = text2.charCodeAt(pos);
|
|
14002
|
-
switch (ch) {
|
|
14003
|
-
case 100 /* d */:
|
|
14004
|
-
case 68 /* D */:
|
|
14005
|
-
case 115 /* s */:
|
|
14006
|
-
case 83 /* S */:
|
|
14007
|
-
case 119 /* w */:
|
|
14008
|
-
case 87 /* W */:
|
|
14009
|
-
pos++;
|
|
14010
|
-
return true;
|
|
14011
|
-
case 80 /* P */:
|
|
14012
|
-
isCharacterComplement = true;
|
|
14013
|
-
case 112 /* p */:
|
|
14014
|
-
pos++;
|
|
14015
|
-
if (text2.charCodeAt(pos) === 123 /* openBrace */) {
|
|
14016
|
-
pos++;
|
|
14017
|
-
const propertyNameOrValueStart = pos;
|
|
14018
|
-
const propertyNameOrValue = scanWordCharacters();
|
|
14019
|
-
if (text2.charCodeAt(pos) === 61 /* equals */) {
|
|
14020
|
-
const propertyName = nonBinaryUnicodeProperties.get(propertyNameOrValue);
|
|
14021
|
-
if (pos === propertyNameOrValueStart) {
|
|
14022
|
-
error2(Diagnostics.Expected_a_Unicode_property_name);
|
|
14023
|
-
} else if (propertyName === void 0) {
|
|
14024
|
-
error2(Diagnostics.Unknown_Unicode_property_name, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
14025
|
-
const suggestion = getSpellingSuggestion(propertyNameOrValue, nonBinaryUnicodeProperties.keys(), identity);
|
|
14026
|
-
if (suggestion) {
|
|
14027
|
-
error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
|
|
14028
|
-
}
|
|
14029
|
-
}
|
|
14030
|
-
pos++;
|
|
14031
|
-
const propertyValueStart = pos;
|
|
14032
|
-
const propertyValue = scanWordCharacters();
|
|
14033
|
-
if (pos === propertyValueStart) {
|
|
14034
|
-
error2(Diagnostics.Expected_a_Unicode_property_value);
|
|
14035
|
-
} else if (propertyName !== void 0 && !valuesOfNonBinaryUnicodeProperties[propertyName].has(propertyValue)) {
|
|
14036
|
-
error2(Diagnostics.Unknown_Unicode_property_value, propertyValueStart, pos - propertyValueStart);
|
|
14037
|
-
const suggestion = getSpellingSuggestion(propertyValue, valuesOfNonBinaryUnicodeProperties[propertyName], identity);
|
|
14038
|
-
if (suggestion) {
|
|
14039
|
-
error2(Diagnostics.Did_you_mean_0, propertyValueStart, pos - propertyValueStart, suggestion);
|
|
14040
|
-
}
|
|
14041
|
-
}
|
|
14042
|
-
} else {
|
|
14043
|
-
if (pos === propertyNameOrValueStart) {
|
|
14044
|
-
error2(Diagnostics.Expected_a_Unicode_property_name_or_value);
|
|
14045
|
-
} else if (binaryUnicodePropertiesOfStrings.has(propertyNameOrValue)) {
|
|
14046
|
-
if (!unicodeSetsMode) {
|
|
14047
|
-
error2(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);
|
|
14048
|
-
} else if (isCharacterComplement) {
|
|
14049
|
-
error2(Diagnostics.Anything_that_would_possibly_match_more_than_a_single_character_is_invalid_inside_a_negated_character_class, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
14050
|
-
} else {
|
|
14051
|
-
mayContainStrings = true;
|
|
14052
|
-
}
|
|
14053
|
-
} else if (!valuesOfNonBinaryUnicodeProperties.General_Category.has(propertyNameOrValue) && !binaryUnicodeProperties.has(propertyNameOrValue)) {
|
|
14054
|
-
error2(Diagnostics.Unknown_Unicode_property_name_or_value, propertyNameOrValueStart, pos - propertyNameOrValueStart);
|
|
14055
|
-
const suggestion = getSpellingSuggestion(propertyNameOrValue, [...valuesOfNonBinaryUnicodeProperties.General_Category, ...binaryUnicodeProperties, ...binaryUnicodePropertiesOfStrings], identity);
|
|
14056
|
-
if (suggestion) {
|
|
14057
|
-
error2(Diagnostics.Did_you_mean_0, propertyNameOrValueStart, pos - propertyNameOrValueStart, suggestion);
|
|
14058
|
-
}
|
|
14059
|
-
}
|
|
14060
|
-
}
|
|
14061
|
-
scanExpectedChar(125 /* closeBrace */);
|
|
14062
|
-
if (!unicodeMode) {
|
|
14063
|
-
error2(Diagnostics.Unicode_property_value_expressions_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set, start3, pos - start3);
|
|
14064
|
-
}
|
|
14065
|
-
} else if (unicodeMode) {
|
|
14066
|
-
error2(Diagnostics._0_must_be_followed_by_a_Unicode_property_value_expression_enclosed_in_braces, pos - 2, 2, String.fromCharCode(ch));
|
|
14067
|
-
}
|
|
14068
|
-
return true;
|
|
14069
|
-
}
|
|
14070
|
-
return false;
|
|
14071
|
-
}
|
|
14072
|
-
function scanWordCharacters() {
|
|
14073
|
-
let value = "";
|
|
14074
|
-
while (pos < end2) {
|
|
14075
|
-
const ch = text2.charCodeAt(pos);
|
|
14076
|
-
if (!isWordCharacter(ch)) {
|
|
14077
|
-
break;
|
|
14078
|
-
}
|
|
14079
|
-
value += String.fromCharCode(ch);
|
|
14080
|
-
pos++;
|
|
14081
|
-
}
|
|
14082
|
-
return value;
|
|
14083
|
-
}
|
|
14084
|
-
function scanSourceCharacter() {
|
|
14085
|
-
const size = unicodeMode ? charSize(codePointAt(text2, pos)) : 1;
|
|
14086
|
-
pos += size;
|
|
14087
|
-
return text2.substring(pos - size, pos);
|
|
14088
|
-
}
|
|
14089
|
-
function scanExpectedChar(ch) {
|
|
14090
|
-
if (text2.charCodeAt(pos) === ch) {
|
|
14091
|
-
pos++;
|
|
14092
|
-
} else {
|
|
14093
|
-
error2(Diagnostics._0_expected, pos, 0, String.fromCharCode(ch));
|
|
14094
|
-
}
|
|
14095
|
-
}
|
|
14096
|
-
scanDisjunction(
|
|
14097
|
-
/*isInGroup*/
|
|
14098
|
-
false
|
|
14099
|
-
);
|
|
14100
|
-
forEach(groupNameReferences, (reference) => {
|
|
14101
|
-
if (!groupSpecifiers.has(reference.name)) {
|
|
14102
|
-
error2(Diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end - reference.pos, reference.name);
|
|
14103
|
-
}
|
|
14104
|
-
});
|
|
14105
|
-
forEach(decimalEscapes, (escape) => {
|
|
14106
|
-
if (escape.value > numberOfCapturingGroups) {
|
|
14107
|
-
if (numberOfCapturingGroups) {
|
|
14108
|
-
error2(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);
|
|
14109
|
-
} else {
|
|
14110
|
-
error2(Diagnostics.Decimal_escapes_are_invalid_when_there_are_no_capturing_groups_in_a_regular_expression, escape.pos, escape.end - escape.pos);
|
|
14111
|
-
}
|
|
14112
|
-
}
|
|
14113
|
-
});
|
|
14114
|
-
}
|
|
14115
13205
|
}
|
|
14116
13206
|
function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
|
|
14117
13207
|
const type = getDirectiveFromComment(text2.trimStart(), commentDirectiveRegEx);
|
|
@@ -14334,6 +13424,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
14334
13424
|
pos--;
|
|
14335
13425
|
const extendedCookedChar = peekExtendedUnicodeEscape();
|
|
14336
13426
|
if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) {
|
|
13427
|
+
pos += 3;
|
|
13428
|
+
tokenFlags |= 8 /* ExtendedUnicodeEscape */;
|
|
14337
13429
|
tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
14338
13430
|
return token = getIdentifierToken();
|
|
14339
13431
|
}
|
|
@@ -14474,22 +13566,6 @@ var utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fro
|
|
|
14474
13566
|
function utf16EncodeAsString(codePoint) {
|
|
14475
13567
|
return utf16EncodeAsStringWorker(codePoint);
|
|
14476
13568
|
}
|
|
14477
|
-
var nonBinaryUnicodeProperties = new Map(Object.entries({
|
|
14478
|
-
General_Category: "General_Category",
|
|
14479
|
-
gc: "General_Category",
|
|
14480
|
-
Script: "Script",
|
|
14481
|
-
sc: "Script",
|
|
14482
|
-
Script_Extensions: "Script_Extensions",
|
|
14483
|
-
scx: "Script_Extensions"
|
|
14484
|
-
}));
|
|
14485
|
-
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"]);
|
|
14486
|
-
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"]);
|
|
14487
|
-
var valuesOfNonBinaryUnicodeProperties = {
|
|
14488
|
-
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"]),
|
|
14489
|
-
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"]),
|
|
14490
|
-
Script_Extensions: /* @__PURE__ */ new Set()
|
|
14491
|
-
// Currently empty
|
|
14492
|
-
};
|
|
14493
13569
|
|
|
14494
13570
|
// src/compiler/utilitiesPublic.ts
|
|
14495
13571
|
function isExternalModuleNameRelative(moduleName) {
|
|
@@ -32354,10 +31430,7 @@ var Parser;
|
|
|
32354
31430
|
function parseErrorAtPosition(start2, length2, message, ...args) {
|
|
32355
31431
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
32356
31432
|
let result;
|
|
32357
|
-
if (
|
|
32358
|
-
result = createDetachedDiagnostic(fileName, sourceText, start2, length2, message, ...args);
|
|
32359
|
-
addRelatedInfo(lastError, result);
|
|
32360
|
-
} else if (!lastError || start2 !== lastError.start) {
|
|
31433
|
+
if (!lastError || start2 !== lastError.start) {
|
|
32361
31434
|
result = createDetachedDiagnostic(fileName, sourceText, start2, length2, message, ...args);
|
|
32362
31435
|
parseDiagnostics.push(result);
|
|
32363
31436
|
}
|
|
@@ -32513,7 +31586,7 @@ var Parser;
|
|
|
32513
31586
|
parseErrorForInvalidName(Diagnostics.Type_alias_name_cannot_be_0, Diagnostics.Type_alias_must_be_given_a_name, 64 /* EqualsToken */);
|
|
32514
31587
|
return;
|
|
32515
31588
|
}
|
|
32516
|
-
const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions,
|
|
31589
|
+
const suggestion = getSpellingSuggestion(expressionText, viableKeywordSuggestions, (n) => n) ?? getSpaceSuggestion(expressionText);
|
|
32517
31590
|
if (suggestion) {
|
|
32518
31591
|
parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion);
|
|
32519
31592
|
return;
|
|
@@ -53332,7 +52405,7 @@ function createTypeChecker(host) {
|
|
|
53332
52405
|
return symbol && !!symbol.valueDeclaration && isExpression(symbol.valueDeclaration) && !isContextSensitive(symbol.valueDeclaration);
|
|
53333
52406
|
}
|
|
53334
52407
|
function toNodeBuilderFlags(flags = 0 /* None */) {
|
|
53335
|
-
return flags &
|
|
52408
|
+
return flags & 848330095 /* NodeBuilderFlagsMask */;
|
|
53336
52409
|
}
|
|
53337
52410
|
function isClassInstanceSide(type) {
|
|
53338
52411
|
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) & 16777216 /* IsClassInstanceClone */));
|
|
@@ -53581,7 +52654,7 @@ function createTypeChecker(host) {
|
|
|
53581
52654
|
}
|
|
53582
52655
|
return factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, constraintNode));
|
|
53583
52656
|
}
|
|
53584
|
-
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */
|
|
52657
|
+
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */) {
|
|
53585
52658
|
const name2 = typeParameterToName(type, context);
|
|
53586
52659
|
context.approximateLength += idText(name2).length;
|
|
53587
52660
|
return factory.createTypeReferenceNode(
|
|
@@ -53792,6 +52865,21 @@ function createTypeChecker(host) {
|
|
|
53792
52865
|
const typeId = type2.id;
|
|
53793
52866
|
const symbol = type2.symbol;
|
|
53794
52867
|
if (symbol) {
|
|
52868
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
52869
|
+
if (isInstantiationExpressionType) {
|
|
52870
|
+
const instantiationExpressionType = type2;
|
|
52871
|
+
const existing = instantiationExpressionType.node;
|
|
52872
|
+
if (isTypeQueryNode(existing) && getTypeFromTypeNode(existing) === type2) {
|
|
52873
|
+
const typeNode = serializeExistingTypeNode(context, existing);
|
|
52874
|
+
if (typeNode) {
|
|
52875
|
+
return typeNode;
|
|
52876
|
+
}
|
|
52877
|
+
}
|
|
52878
|
+
if ((_a2 = context.visitedTypes) == null ? void 0 : _a2.has(typeId)) {
|
|
52879
|
+
return createElidedInformationPlaceholder(context);
|
|
52880
|
+
}
|
|
52881
|
+
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
52882
|
+
}
|
|
53795
52883
|
const isInstanceType = isClassInstanceSide(type2) ? 788968 /* Type */ : 111551 /* Value */;
|
|
53796
52884
|
if (isJSConstructor(symbol.valueDeclaration)) {
|
|
53797
52885
|
return symbolToTypeNode(symbol, context, isInstanceType);
|
|
@@ -53803,7 +52891,7 @@ function createTypeChecker(host) {
|
|
|
53803
52891
|
false
|
|
53804
52892
|
).accessibility !== 0 /* Accessible */)) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) {
|
|
53805
52893
|
return symbolToTypeNode(symbol, context, isInstanceType);
|
|
53806
|
-
} else if ((
|
|
52894
|
+
} else if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
|
|
53807
52895
|
const typeAlias = getTypeAliasForTypeLiteral(type2);
|
|
53808
52896
|
if (typeAlias) {
|
|
53809
52897
|
return symbolToTypeNode(typeAlias, context, 788968 /* Type */);
|
|
@@ -53814,20 +52902,6 @@ function createTypeChecker(host) {
|
|
|
53814
52902
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
53815
52903
|
}
|
|
53816
52904
|
} else {
|
|
53817
|
-
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
53818
|
-
if (isInstantiationExpressionType) {
|
|
53819
|
-
const instantiationExpressionType = type2;
|
|
53820
|
-
if (isTypeQueryNode(instantiationExpressionType.node)) {
|
|
53821
|
-
const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
|
|
53822
|
-
if (typeNode) {
|
|
53823
|
-
return typeNode;
|
|
53824
|
-
}
|
|
53825
|
-
}
|
|
53826
|
-
if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
|
|
53827
|
-
return createElidedInformationPlaceholder(context);
|
|
53828
|
-
}
|
|
53829
|
-
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
53830
|
-
}
|
|
53831
52905
|
return createTypeNodeFromObjectType(type2);
|
|
53832
52906
|
}
|
|
53833
52907
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
@@ -54381,36 +53455,65 @@ function createTypeChecker(host) {
|
|
|
54381
53455
|
true
|
|
54382
53456
|
)[0];
|
|
54383
53457
|
let cleanup;
|
|
54384
|
-
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
|
|
54385
|
-
|
|
54386
|
-
|
|
54387
|
-
|
|
54388
|
-
|
|
54389
|
-
|
|
54390
|
-
if (
|
|
54391
|
-
|
|
54392
|
-
|
|
54393
|
-
|
|
54394
|
-
|
|
54395
|
-
|
|
54396
|
-
|
|
53458
|
+
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && (some(expandedParams) || some(signature.typeParameters))) {
|
|
53459
|
+
let pushFakeScope2 = function(kind2, addAll) {
|
|
53460
|
+
Debug.assert(context.enclosingDeclaration);
|
|
53461
|
+
let existingFakeScope;
|
|
53462
|
+
if (getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration === kind2) {
|
|
53463
|
+
existingFakeScope = context.enclosingDeclaration;
|
|
53464
|
+
} else if (context.enclosingDeclaration.parent && getNodeLinks(context.enclosingDeclaration.parent).fakeScopeForSignatureDeclaration === kind2) {
|
|
53465
|
+
existingFakeScope = context.enclosingDeclaration.parent;
|
|
53466
|
+
}
|
|
53467
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
53468
|
+
const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
|
|
53469
|
+
let newLocals;
|
|
53470
|
+
addAll((name, symbol) => {
|
|
53471
|
+
if (!locals.has(name)) {
|
|
53472
|
+
newLocals = append(newLocals, name);
|
|
53473
|
+
locals.set(name, symbol);
|
|
53474
|
+
}
|
|
53475
|
+
});
|
|
53476
|
+
if (!newLocals)
|
|
53477
|
+
return;
|
|
53478
|
+
const oldCleanup = cleanup;
|
|
53479
|
+
function undo() {
|
|
54397
53480
|
forEach(newLocals, (s) => locals.delete(s));
|
|
54398
|
-
|
|
54399
|
-
|
|
53481
|
+
oldCleanup == null ? void 0 : oldCleanup();
|
|
53482
|
+
}
|
|
54400
53483
|
if (existingFakeScope) {
|
|
54401
|
-
cleanup =
|
|
53484
|
+
cleanup = undo;
|
|
54402
53485
|
} else {
|
|
54403
53486
|
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
54404
|
-
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration =
|
|
53487
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = kind2;
|
|
54405
53488
|
fakeScope.locals = locals;
|
|
54406
53489
|
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
54407
53490
|
setParent(fakeScope, saveEnclosingDeclaration);
|
|
54408
53491
|
context.enclosingDeclaration = fakeScope;
|
|
54409
53492
|
cleanup = () => {
|
|
54410
53493
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
54411
|
-
|
|
53494
|
+
undo();
|
|
54412
53495
|
};
|
|
54413
53496
|
}
|
|
53497
|
+
};
|
|
53498
|
+
var pushFakeScope = pushFakeScope2;
|
|
53499
|
+
pushFakeScope2(
|
|
53500
|
+
"params",
|
|
53501
|
+
(add) => {
|
|
53502
|
+
for (const param of expandedParams) {
|
|
53503
|
+
add(param.escapedName, param);
|
|
53504
|
+
}
|
|
53505
|
+
}
|
|
53506
|
+
);
|
|
53507
|
+
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
53508
|
+
pushFakeScope2(
|
|
53509
|
+
"typeParams",
|
|
53510
|
+
(add) => {
|
|
53511
|
+
for (const typeParam of signature.typeParameters ?? emptyArray) {
|
|
53512
|
+
const typeParamName = typeParameterToName(typeParam, context).escapedText;
|
|
53513
|
+
add(typeParamName, typeParam.symbol);
|
|
53514
|
+
}
|
|
53515
|
+
}
|
|
53516
|
+
);
|
|
54414
53517
|
}
|
|
54415
53518
|
}
|
|
54416
53519
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
|
|
@@ -54955,7 +54058,7 @@ function createTypeChecker(host) {
|
|
|
54955
54058
|
return identifier;
|
|
54956
54059
|
}
|
|
54957
54060
|
}
|
|
54958
|
-
function
|
|
54061
|
+
function typeParameterShadowsOtherTypeParameterInScope(escapedName, context, type) {
|
|
54959
54062
|
const result = resolveName(
|
|
54960
54063
|
context.enclosingDeclaration,
|
|
54961
54064
|
escapedName,
|
|
@@ -54966,11 +54069,8 @@ function createTypeChecker(host) {
|
|
|
54966
54069
|
/*isUse*/
|
|
54967
54070
|
false
|
|
54968
54071
|
);
|
|
54969
|
-
if (result) {
|
|
54970
|
-
|
|
54971
|
-
return false;
|
|
54972
|
-
}
|
|
54973
|
-
return true;
|
|
54072
|
+
if (result && result.flags & 262144 /* TypeParameter */) {
|
|
54073
|
+
return result !== type.symbol;
|
|
54974
54074
|
}
|
|
54975
54075
|
return false;
|
|
54976
54076
|
}
|
|
@@ -54996,7 +54096,7 @@ function createTypeChecker(host) {
|
|
|
54996
54096
|
const rawtext = result.escapedText;
|
|
54997
54097
|
let i = ((_a = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _a.get(rawtext)) || 0;
|
|
54998
54098
|
let text = rawtext;
|
|
54999
|
-
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) ||
|
|
54099
|
+
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsOtherTypeParameterInScope(text, context, type)) {
|
|
55000
54100
|
i++;
|
|
55001
54101
|
text = `${rawtext}_${i}`;
|
|
55002
54102
|
}
|
|
@@ -55007,7 +54107,7 @@ function createTypeChecker(host) {
|
|
|
55007
54107
|
}
|
|
55008
54108
|
(context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i);
|
|
55009
54109
|
(context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result);
|
|
55010
|
-
(context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(
|
|
54110
|
+
(context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(text);
|
|
55011
54111
|
}
|
|
55012
54112
|
return result;
|
|
55013
54113
|
}
|
|
@@ -55152,7 +54252,10 @@ function createTypeChecker(host) {
|
|
|
55152
54252
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
55153
54253
|
}
|
|
55154
54254
|
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
55155
|
-
|
|
54255
|
+
while (getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration) {
|
|
54256
|
+
enclosingDeclaration = enclosingDeclaration.parent;
|
|
54257
|
+
}
|
|
54258
|
+
return enclosingDeclaration;
|
|
55156
54259
|
}
|
|
55157
54260
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
55158
54261
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
@@ -55232,7 +54335,7 @@ function createTypeChecker(host) {
|
|
|
55232
54335
|
}
|
|
55233
54336
|
if (isIdentifier(node)) {
|
|
55234
54337
|
const type = getDeclaredTypeOfSymbol(sym);
|
|
55235
|
-
const name = sym.flags & 262144 /* TypeParameter */
|
|
54338
|
+
const name = sym.flags & 262144 /* TypeParameter */ ? typeParameterToName(type, context) : factory.cloneNode(node);
|
|
55236
54339
|
name.symbol = sym;
|
|
55237
54340
|
return { introducesError, node: setEmitFlags(setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */) };
|
|
55238
54341
|
}
|
|
@@ -59849,7 +58952,13 @@ function createTypeChecker(host) {
|
|
|
59849
58952
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
59850
58953
|
const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
|
|
59851
58954
|
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
59852
|
-
|
|
58955
|
+
if (isTupleType(modifiersType)) {
|
|
58956
|
+
forEachType(getUnionType(getElementTypes(modifiersType).map((_, i) => getStringLiteralType("" + i))), addMemberForKeyType);
|
|
58957
|
+
} else if (isArrayType(modifiersType)) {
|
|
58958
|
+
addMemberForKeyType(numberType);
|
|
58959
|
+
} else {
|
|
58960
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, include, keyofStringsOnly, addMemberForKeyType);
|
|
58961
|
+
}
|
|
59853
58962
|
} else {
|
|
59854
58963
|
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
59855
58964
|
}
|
|
@@ -61658,7 +60767,7 @@ function createTypeChecker(host) {
|
|
|
61658
60767
|
if (constraint) {
|
|
61659
60768
|
constraints = append(constraints, constraint);
|
|
61660
60769
|
}
|
|
61661
|
-
} else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && node === parent2.type) {
|
|
60770
|
+
} else if (type.flags & 262144 /* TypeParameter */ && parent2.kind === 200 /* MappedType */ && (node === parent2.type || node === parent2.nameType)) {
|
|
61662
60771
|
const mappedType = getTypeFromTypeNode(parent2);
|
|
61663
60772
|
if (getTypeParameterFromMappedType(mappedType) === getActualTypeVariable(type)) {
|
|
61664
60773
|
const typeParameter = getHomomorphicTypeVariable(mappedType);
|
|
@@ -64706,6 +63815,7 @@ function createTypeChecker(host) {
|
|
|
64706
63815
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
64707
63816
|
}
|
|
64708
63817
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
63818
|
+
Debug.assert(type.symbol, "anonymous type must have symbol to be instantiated");
|
|
64709
63819
|
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
64710
63820
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
64711
63821
|
result.declaration = type.declaration;
|
|
@@ -67953,6 +67063,7 @@ function createTypeChecker(host) {
|
|
|
67953
67063
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
67954
67064
|
const targetObjectFlags = getObjectFlags(target2);
|
|
67955
67065
|
if (sourceObjectFlags & 64 /* Instantiated */ && targetObjectFlags & 64 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
67066
|
+
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
67956
67067
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
67957
67068
|
const related = signatureRelatedTo(
|
|
67958
67069
|
sourceSignatures[i],
|
|
@@ -72163,6 +71274,9 @@ function createTypeChecker(host) {
|
|
|
72163
71274
|
}
|
|
72164
71275
|
function getNarrowedTypeWorker(type, candidate, assumeTrue, checkDerived) {
|
|
72165
71276
|
if (!assumeTrue) {
|
|
71277
|
+
if (type === candidate) {
|
|
71278
|
+
return neverType;
|
|
71279
|
+
}
|
|
72166
71280
|
if (checkDerived) {
|
|
72167
71281
|
return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
|
|
72168
71282
|
}
|
|
@@ -72179,6 +71293,9 @@ function createTypeChecker(host) {
|
|
|
72179
71293
|
if (type.flags & 3 /* AnyOrUnknown */) {
|
|
72180
71294
|
return candidate;
|
|
72181
71295
|
}
|
|
71296
|
+
if (type === candidate) {
|
|
71297
|
+
return candidate;
|
|
71298
|
+
}
|
|
72182
71299
|
const isRelated = checkDerived ? isTypeDerivedFrom : isTypeSubtypeOf;
|
|
72183
71300
|
const keyPropertyName = type.flags & 1048576 /* Union */ ? getKeyPropertyName(type) : void 0;
|
|
72184
71301
|
const narrowedType = mapType(candidate, (c) => {
|
|
@@ -78204,14 +77321,7 @@ function createTypeChecker(host) {
|
|
|
78204
77321
|
hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
|
|
78205
77322
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
78206
77323
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
78207
|
-
const result3 = createAnonymousType(
|
|
78208
|
-
/*symbol*/
|
|
78209
|
-
void 0,
|
|
78210
|
-
resolved.members,
|
|
78211
|
-
callSignatures,
|
|
78212
|
-
constructSignatures,
|
|
78213
|
-
resolved.indexInfos
|
|
78214
|
-
);
|
|
77324
|
+
const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
78215
77325
|
result3.objectFlags |= 8388608 /* InstantiationExpressionType */;
|
|
78216
77326
|
result3.node = node;
|
|
78217
77327
|
return result3;
|
|
@@ -151201,7 +150311,17 @@ var errorCodes18 = [
|
|
|
151201
150311
|
Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,
|
|
151202
150312
|
Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,
|
|
151203
150313
|
Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code,
|
|
151204
|
-
Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code
|
|
150314
|
+
Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code,
|
|
150315
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery.code,
|
|
150316
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later.code,
|
|
150317
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom.code,
|
|
150318
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig.code,
|
|
150319
|
+
Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code,
|
|
150320
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig.code,
|
|
150321
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha.code,
|
|
150322
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,
|
|
150323
|
+
Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code,
|
|
150324
|
+
Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code
|
|
151205
150325
|
];
|
|
151206
150326
|
registerCodeFix({
|
|
151207
150327
|
errorCodes: errorCodes18,
|
|
@@ -162918,7 +162038,7 @@ function isPathRelativeToScript(path) {
|
|
|
162918
162038
|
}
|
|
162919
162039
|
return false;
|
|
162920
162040
|
}
|
|
162921
|
-
var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\
|
|
162041
|
+
var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\3"]*)$/;
|
|
162922
162042
|
var nodeModulesDependencyKeys = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
162923
162043
|
function containsSlash(fragment) {
|
|
162924
162044
|
return fragment.includes(directorySeparator);
|
|
@@ -173752,7 +172872,6 @@ __export(ts_exports2, {
|
|
|
173752
172872
|
ProcessLevel: () => ProcessLevel,
|
|
173753
172873
|
ProgramUpdateLevel: () => ProgramUpdateLevel,
|
|
173754
172874
|
QuotePreference: () => QuotePreference,
|
|
173755
|
-
RegularExpressionFlags: () => RegularExpressionFlags,
|
|
173756
172875
|
RelationComparisonResult: () => RelationComparisonResult,
|
|
173757
172876
|
Rename: () => ts_Rename_exports,
|
|
173758
172877
|
ScriptElementKind: () => ScriptElementKind,
|
|
@@ -173878,7 +172997,6 @@ __export(ts_exports2, {
|
|
|
173878
172997
|
changeExtension: () => changeExtension,
|
|
173879
172998
|
changesAffectModuleResolution: () => changesAffectModuleResolution,
|
|
173880
172999
|
changesAffectingProgramStructure: () => changesAffectingProgramStructure,
|
|
173881
|
-
characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
|
|
173882
173000
|
childIsDecorated: () => childIsDecorated,
|
|
173883
173001
|
classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
|
|
173884
173002
|
classHasClassThisAssignment: () => classHasClassThisAssignment,
|
|
@@ -175644,7 +174762,6 @@ __export(ts_exports2, {
|
|
|
175644
174762
|
reducePathComponents: () => reducePathComponents,
|
|
175645
174763
|
refactor: () => ts_refactor_exports,
|
|
175646
174764
|
regExpEscape: () => regExpEscape,
|
|
175647
|
-
regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
|
|
175648
174765
|
relativeComplement: () => relativeComplement,
|
|
175649
174766
|
removeAllComments: () => removeAllComments,
|
|
175650
174767
|
removeEmitHelper: () => removeEmitHelper,
|
|
@@ -188417,7 +187534,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188417
187534
|
ProcessLevel,
|
|
188418
187535
|
ProgramUpdateLevel,
|
|
188419
187536
|
QuotePreference,
|
|
188420
|
-
RegularExpressionFlags,
|
|
188421
187537
|
RelationComparisonResult,
|
|
188422
187538
|
Rename,
|
|
188423
187539
|
ScriptElementKind,
|
|
@@ -188543,7 +187659,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188543
187659
|
changeExtension,
|
|
188544
187660
|
changesAffectModuleResolution,
|
|
188545
187661
|
changesAffectingProgramStructure,
|
|
188546
|
-
characterToRegularExpressionFlag,
|
|
188547
187662
|
childIsDecorated,
|
|
188548
187663
|
classElementOrClassElementParameterIsDecorated,
|
|
188549
187664
|
classHasClassThisAssignment,
|
|
@@ -190309,7 +189424,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
190309
189424
|
reducePathComponents,
|
|
190310
189425
|
refactor,
|
|
190311
189426
|
regExpEscape,
|
|
190312
|
-
regularExpressionFlagToCharacter,
|
|
190313
189427
|
relativeComplement,
|
|
190314
189428
|
removeAllComments,
|
|
190315
189429
|
removeEmitHelper,
|