@typescript-deploys/pr-build 4.9.0-pr-49929-7 → 4.9.0-pr-50776-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/de/diagnosticMessages.generated.json +1 -2
- package/lib/es/diagnosticMessages.generated.json +1 -2
- package/lib/ja/diagnosticMessages.generated.json +1 -2
- package/lib/ko/diagnosticMessages.generated.json +1 -2
- package/lib/lib.dom.d.ts +199 -58
- package/lib/lib.webworker.d.ts +73 -24
- package/lib/pt-br/diagnosticMessages.generated.json +1 -2
- package/lib/ru/diagnosticMessages.generated.json +1 -2
- package/lib/tr/diagnosticMessages.generated.json +1 -2
- package/lib/tsc.js +309 -332
- package/lib/tsserver.js +608 -572
- package/lib/tsserverlibrary.d.ts +50 -50
- package/lib/tsserverlibrary.js +608 -572
- package/lib/typescript.d.ts +49 -49
- package/lib/typescript.js +607 -570
- package/lib/typescriptServices.d.ts +49 -49
- package/lib/typescriptServices.js +607 -570
- package/lib/typingsInstaller.js +336 -395
- package/lib/zh-tw/diagnosticMessages.generated.json +1 -2
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.
|
|
92
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20220922");
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -278,6 +278,11 @@ var ts;
|
|
|
278
278
|
return result;
|
|
279
279
|
}
|
|
280
280
|
ts.intersperse = intersperse;
|
|
281
|
+
/**
|
|
282
|
+
* Iterates through `array` by index and performs the callback on each element of array until the callback
|
|
283
|
+
* returns a falsey value, then returns false.
|
|
284
|
+
* If no such value is found, the callback is applied to each element of array and `true` is returned.
|
|
285
|
+
*/
|
|
281
286
|
function every(array, callback) {
|
|
282
287
|
if (array) {
|
|
283
288
|
for (var i = 0; i < array.length; i++) {
|
|
@@ -289,10 +294,6 @@ var ts;
|
|
|
289
294
|
return true;
|
|
290
295
|
}
|
|
291
296
|
ts.every = every;
|
|
292
|
-
function isArrayOf(array, callback) {
|
|
293
|
-
return every(array, callback);
|
|
294
|
-
}
|
|
295
|
-
ts.isArrayOf = isArrayOf;
|
|
296
297
|
function find(array, predicate, startIndex) {
|
|
297
298
|
if (array === undefined)
|
|
298
299
|
return undefined;
|
|
@@ -969,7 +970,6 @@ var ts;
|
|
|
969
970
|
}
|
|
970
971
|
ts.sum = sum;
|
|
971
972
|
function append(to, value) {
|
|
972
|
-
// If to is Push<T>, return value is void, so safe to cast to T[].
|
|
973
973
|
if (value === undefined)
|
|
974
974
|
return to;
|
|
975
975
|
if (to === undefined)
|
|
@@ -2673,7 +2673,7 @@ var ts;
|
|
|
2673
2673
|
if (typeof func !== "function") {
|
|
2674
2674
|
return "";
|
|
2675
2675
|
}
|
|
2676
|
-
else if (
|
|
2676
|
+
else if (ts.hasProperty(func, "name")) {
|
|
2677
2677
|
return func.name;
|
|
2678
2678
|
}
|
|
2679
2679
|
else {
|
|
@@ -2998,7 +2998,7 @@ var ts;
|
|
|
2998
2998
|
];
|
|
2999
2999
|
for (var _i = 0, nodeConstructors_1 = nodeConstructors; _i < nodeConstructors_1.length; _i++) {
|
|
3000
3000
|
var ctor = nodeConstructors_1[_i];
|
|
3001
|
-
if (!ctor.prototype
|
|
3001
|
+
if (!ts.hasProperty(ctor.prototype, "__debugKind")) {
|
|
3002
3002
|
Object.defineProperties(ctor.prototype, {
|
|
3003
3003
|
// for use with vscode-js-debug's new customDescriptionGenerator in launch.json
|
|
3004
3004
|
__tsDebuggerDisplay: {
|
|
@@ -3853,7 +3853,6 @@ var ts;
|
|
|
3853
3853
|
var typeCatalog = []; // NB: id is index + 1
|
|
3854
3854
|
var legendPath;
|
|
3855
3855
|
var legend = [];
|
|
3856
|
-
;
|
|
3857
3856
|
/** Starts tracing for the given project. */
|
|
3858
3857
|
function startTracing(tracingMode, traceDir, configFilePath) {
|
|
3859
3858
|
ts.Debug.assert(!ts.tracing, "Tracing already started");
|
|
@@ -8685,8 +8684,6 @@ var ts;
|
|
|
8685
8684
|
The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, ts.DiagnosticCategory.Error, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."),
|
|
8686
8685
|
The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),
|
|
8687
8686
|
The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),
|
|
8688
|
-
The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol: diag(2360, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360", "The left-hand side of an 'in' expression must be a private identifier or of type 'any', 'string', 'number', or 'symbol'."),
|
|
8689
|
-
The_right_hand_side_of_an_in_expression_must_not_be_a_primitive: diag(2361, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361", "The right-hand side of an 'in' expression must not be a primitive."),
|
|
8690
8687
|
The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
|
|
8691
8688
|
The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
|
|
8692
8689
|
The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: diag(2364, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", "The left-hand side of an assignment expression must be a variable or a property access."),
|
|
@@ -8935,6 +8932,7 @@ var ts;
|
|
|
8935
8932
|
Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, ts.DiagnosticCategory.Error, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."),
|
|
8936
8933
|
Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation: diag(2636, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636", "Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),
|
|
8937
8934
|
Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types: diag(2637, ts.DiagnosticCategory.Error, "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637", "Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),
|
|
8935
|
+
Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator: diag(2638, ts.DiagnosticCategory.Error, "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638", "Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),
|
|
8938
8936
|
Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
|
|
8939
8937
|
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
|
|
8940
8938
|
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
|
|
@@ -9115,6 +9113,7 @@ var ts;
|
|
|
9115
9113
|
_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, ts.DiagnosticCategory.Error, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
|
|
9116
9114
|
We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, ts.DiagnosticCategory.Error, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
|
|
9117
9115
|
Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, ts.DiagnosticCategory.Error, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
9116
|
+
This_condition_will_always_return_0: diag(2845, ts.DiagnosticCategory.Error, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."),
|
|
9118
9117
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
9119
9118
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
9120
9119
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -10057,6 +10056,8 @@ var ts;
|
|
|
10057
10056
|
Delete_unused_param_tag_0: diag(95171, ts.DiagnosticCategory.Message, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"),
|
|
10058
10057
|
Delete_all_unused_param_tags: diag(95172, ts.DiagnosticCategory.Message, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"),
|
|
10059
10058
|
Rename_param_tag_name_0_to_1: diag(95173, ts.DiagnosticCategory.Message, "Rename_param_tag_name_0_to_1_95173", "Rename '@param' tag name '{0}' to '{1}'"),
|
|
10059
|
+
Use_0: diag(95174, ts.DiagnosticCategory.Message, "Use_0_95174", "Use `{0}`."),
|
|
10060
|
+
Use_Number_isNaN_in_all_conditions: diag(95175, ts.DiagnosticCategory.Message, "Use_Number_isNaN_in_all_conditions_95175", "Use `Number.isNaN` in all conditions."),
|
|
10060
10061
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
10061
10062
|
Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
10062
10063
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -10318,7 +10319,7 @@ var ts;
|
|
|
10318
10319
|
ts.stringToToken = stringToToken;
|
|
10319
10320
|
/* @internal */
|
|
10320
10321
|
function computeLineStarts(text) {
|
|
10321
|
-
var result =
|
|
10322
|
+
var result = [];
|
|
10322
10323
|
var pos = 0;
|
|
10323
10324
|
var lineStart = 0;
|
|
10324
10325
|
while (pos < text.length) {
|
|
@@ -10795,7 +10796,9 @@ var ts;
|
|
|
10795
10796
|
}
|
|
10796
10797
|
ts.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange;
|
|
10797
10798
|
function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) {
|
|
10798
|
-
if (comments
|
|
10799
|
+
if (!comments) {
|
|
10800
|
+
comments = [];
|
|
10801
|
+
}
|
|
10799
10802
|
comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine });
|
|
10800
10803
|
return comments;
|
|
10801
10804
|
}
|
|
@@ -11877,12 +11880,36 @@ var ts;
|
|
|
11877
11880
|
pos++;
|
|
11878
11881
|
return token = 0 /* SyntaxKind.Unknown */;
|
|
11879
11882
|
}
|
|
11880
|
-
|
|
11883
|
+
var charAfterHash = codePointAt(text, pos + 1);
|
|
11884
|
+
if (charAfterHash === 92 /* CharacterCodes.backslash */) {
|
|
11885
|
+
pos++;
|
|
11886
|
+
var extendedCookedChar_1 = peekExtendedUnicodeEscape();
|
|
11887
|
+
if (extendedCookedChar_1 >= 0 && isIdentifierStart(extendedCookedChar_1, languageVersion)) {
|
|
11888
|
+
pos += 3;
|
|
11889
|
+
tokenFlags |= 8 /* TokenFlags.ExtendedUnicodeEscape */;
|
|
11890
|
+
tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
11891
|
+
return token = 80 /* SyntaxKind.PrivateIdentifier */;
|
|
11892
|
+
}
|
|
11893
|
+
var cookedChar_1 = peekUnicodeEscape();
|
|
11894
|
+
if (cookedChar_1 >= 0 && isIdentifierStart(cookedChar_1, languageVersion)) {
|
|
11895
|
+
pos += 6;
|
|
11896
|
+
tokenFlags |= 1024 /* TokenFlags.UnicodeEscape */;
|
|
11897
|
+
tokenValue = "#" + String.fromCharCode(cookedChar_1) + scanIdentifierParts();
|
|
11898
|
+
return token = 80 /* SyntaxKind.PrivateIdentifier */;
|
|
11899
|
+
}
|
|
11900
|
+
pos--;
|
|
11901
|
+
}
|
|
11902
|
+
if (isIdentifierStart(charAfterHash, languageVersion)) {
|
|
11881
11903
|
pos++;
|
|
11882
|
-
scanIdentifier
|
|
11904
|
+
// We're relying on scanIdentifier's behavior and adjusting the token kind after the fact.
|
|
11905
|
+
// Notably absent from this block is the fact that calling a function named "scanIdentifier",
|
|
11906
|
+
// but identifiers don't include '#', and that function doesn't deal with it at all.
|
|
11907
|
+
// This works because 'scanIdentifier' tries to reuse source characters and builds up substrings;
|
|
11908
|
+
// however, it starts at the 'tokenPos' which includes the '#', and will "accidentally" prepend the '#' for us.
|
|
11909
|
+
scanIdentifier(charAfterHash, languageVersion);
|
|
11883
11910
|
}
|
|
11884
11911
|
else {
|
|
11885
|
-
tokenValue =
|
|
11912
|
+
tokenValue = "#";
|
|
11886
11913
|
error(ts.Diagnostics.Invalid_character, pos++, charSize(ch));
|
|
11887
11914
|
}
|
|
11888
11915
|
return token = 80 /* SyntaxKind.PrivateIdentifier */;
|
|
@@ -12653,8 +12680,6 @@ var ts;
|
|
|
12653
12680
|
return false;
|
|
12654
12681
|
}
|
|
12655
12682
|
ts.isEmptyBindingPattern = isEmptyBindingPattern;
|
|
12656
|
-
// TODO(jakebailey): It is very weird that we have BindingElement and ArrayBindingElement;
|
|
12657
|
-
// we should have ObjectBindingElement and ArrayBindingElement, which are both BindingElement.
|
|
12658
12683
|
function isEmptyBindingElement(node) {
|
|
12659
12684
|
if (ts.isOmittedExpression(node)) {
|
|
12660
12685
|
return true;
|
|
@@ -12773,10 +12798,7 @@ var ts;
|
|
|
12773
12798
|
node = node.original;
|
|
12774
12799
|
}
|
|
12775
12800
|
}
|
|
12776
|
-
|
|
12777
|
-
return node;
|
|
12778
|
-
}
|
|
12779
|
-
return nodeTest(node) ? node : undefined;
|
|
12801
|
+
return !nodeTest || nodeTest(node) ? node : undefined;
|
|
12780
12802
|
}
|
|
12781
12803
|
ts.getOriginalNode = getOriginalNode;
|
|
12782
12804
|
function findAncestor(node, callback) {
|
|
@@ -13454,7 +13476,7 @@ var ts;
|
|
|
13454
13476
|
// Node Arrays
|
|
13455
13477
|
/* @internal */
|
|
13456
13478
|
function isNodeArray(array) {
|
|
13457
|
-
return
|
|
13479
|
+
return ts.hasProperty(array, "pos") && ts.hasProperty(array, "end");
|
|
13458
13480
|
}
|
|
13459
13481
|
ts.isNodeArray = isNodeArray;
|
|
13460
13482
|
// Literals
|
|
@@ -13802,13 +13824,6 @@ var ts;
|
|
|
13802
13824
|
return false;
|
|
13803
13825
|
}
|
|
13804
13826
|
ts.isDeclarationBindingElement = isDeclarationBindingElement;
|
|
13805
|
-
function isBindingOrAssignmentElement(node) {
|
|
13806
|
-
return ts.isVariableDeclaration(node)
|
|
13807
|
-
|| ts.isParameter(node)
|
|
13808
|
-
|| isObjectBindingOrAssignmentElement(node)
|
|
13809
|
-
|| isArrayBindingOrAssignmentElement(node);
|
|
13810
|
-
}
|
|
13811
|
-
ts.isBindingOrAssignmentElement = isBindingOrAssignmentElement;
|
|
13812
13827
|
/**
|
|
13813
13828
|
* Determines whether a node is a BindingOrAssignmentPattern
|
|
13814
13829
|
*/
|
|
@@ -13857,22 +13872,6 @@ var ts;
|
|
|
13857
13872
|
}
|
|
13858
13873
|
ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern;
|
|
13859
13874
|
/* @internal */
|
|
13860
|
-
function isArrayBindingOrAssignmentElement(node) {
|
|
13861
|
-
switch (node.kind) {
|
|
13862
|
-
case 205 /* SyntaxKind.BindingElement */:
|
|
13863
|
-
case 229 /* SyntaxKind.OmittedExpression */: // Elision
|
|
13864
|
-
case 227 /* SyntaxKind.SpreadElement */: // AssignmentRestElement
|
|
13865
|
-
case 206 /* SyntaxKind.ArrayLiteralExpression */: // ArrayAssignmentPattern
|
|
13866
|
-
case 207 /* SyntaxKind.ObjectLiteralExpression */: // ObjectAssignmentPattern
|
|
13867
|
-
case 79 /* SyntaxKind.Identifier */: // DestructuringAssignmentTarget
|
|
13868
|
-
case 208 /* SyntaxKind.PropertyAccessExpression */: // DestructuringAssignmentTarget
|
|
13869
|
-
case 209 /* SyntaxKind.ElementAccessExpression */: // DestructuringAssignmentTarget
|
|
13870
|
-
return true;
|
|
13871
|
-
}
|
|
13872
|
-
return ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true); // AssignmentElement
|
|
13873
|
-
}
|
|
13874
|
-
ts.isArrayBindingOrAssignmentElement = isArrayBindingOrAssignmentElement;
|
|
13875
|
-
/* @internal */
|
|
13876
13875
|
function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
|
|
13877
13876
|
var kind = node.kind;
|
|
13878
13877
|
return kind === 208 /* SyntaxKind.PropertyAccessExpression */
|
|
@@ -13985,23 +13984,6 @@ var ts;
|
|
|
13985
13984
|
}
|
|
13986
13985
|
}
|
|
13987
13986
|
ts.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite;
|
|
13988
|
-
/**
|
|
13989
|
-
* See isExpression; not for use in transforms.
|
|
13990
|
-
* @internal
|
|
13991
|
-
*/
|
|
13992
|
-
function isLiteralTypeLiteral(node) {
|
|
13993
|
-
node = skipPartiallyEmittedExpressions(node);
|
|
13994
|
-
switch (skipPartiallyEmittedExpressions(node).kind) {
|
|
13995
|
-
case 104 /* SyntaxKind.NullKeyword */:
|
|
13996
|
-
case 110 /* SyntaxKind.TrueKeyword */:
|
|
13997
|
-
case 95 /* SyntaxKind.FalseKeyword */:
|
|
13998
|
-
case 221 /* SyntaxKind.PrefixUnaryExpression */:
|
|
13999
|
-
return true;
|
|
14000
|
-
default:
|
|
14001
|
-
return isLiteralExpression(node);
|
|
14002
|
-
}
|
|
14003
|
-
}
|
|
14004
|
-
ts.isLiteralTypeLiteral = isLiteralTypeLiteral;
|
|
14005
13987
|
/* @internal */
|
|
14006
13988
|
/**
|
|
14007
13989
|
* Determines whether a node is an expression based only on its kind.
|
|
@@ -14966,7 +14948,6 @@ var ts;
|
|
|
14966
14948
|
return emitNode && emitNode.flags || 0;
|
|
14967
14949
|
}
|
|
14968
14950
|
ts.getEmitFlags = getEmitFlags;
|
|
14969
|
-
;
|
|
14970
14951
|
function getScriptTargetFeatures() {
|
|
14971
14952
|
return {
|
|
14972
14953
|
es2015: {
|
|
@@ -15281,7 +15262,6 @@ var ts;
|
|
|
15281
15262
|
}
|
|
15282
15263
|
ts.isBlockScope = isBlockScope;
|
|
15283
15264
|
function isDeclarationWithTypeParameters(node) {
|
|
15284
|
-
ts.Debug.type(node);
|
|
15285
15265
|
switch (node.kind) {
|
|
15286
15266
|
case 341 /* SyntaxKind.JSDocCallbackTag */:
|
|
15287
15267
|
case 348 /* SyntaxKind.JSDocTypedefTag */:
|
|
@@ -15294,7 +15274,6 @@ var ts;
|
|
|
15294
15274
|
}
|
|
15295
15275
|
ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;
|
|
15296
15276
|
function isDeclarationWithTypeParameterChildren(node) {
|
|
15297
|
-
ts.Debug.type(node);
|
|
15298
15277
|
switch (node.kind) {
|
|
15299
15278
|
case 176 /* SyntaxKind.CallSignature */:
|
|
15300
15279
|
case 177 /* SyntaxKind.ConstructSignature */:
|
|
@@ -17753,10 +17732,6 @@ var ts;
|
|
|
17753
17732
|
return node.escapedText === "push" || node.escapedText === "unshift";
|
|
17754
17733
|
}
|
|
17755
17734
|
ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
|
|
17756
|
-
// TODO(jakebailey): this function should not be named this. While it does technically
|
|
17757
|
-
// return true if the argument is a ParameterDeclaration, it also returns true for nodes
|
|
17758
|
-
// that are children of ParameterDeclarations inside binding elements.
|
|
17759
|
-
// Probably, this should be called `rootDeclarationIsParameter`.
|
|
17760
17735
|
function isParameterDeclaration(node) {
|
|
17761
17736
|
var root = getRootDeclaration(node);
|
|
17762
17737
|
return root.kind === 166 /* SyntaxKind.Parameter */;
|
|
@@ -19698,7 +19673,7 @@ var ts;
|
|
|
19698
19673
|
}
|
|
19699
19674
|
function isWatchSet(options) {
|
|
19700
19675
|
// Firefox has Object.prototype.watch
|
|
19701
|
-
return options.watch &&
|
|
19676
|
+
return options.watch && ts.hasProperty(options, "watch");
|
|
19702
19677
|
}
|
|
19703
19678
|
ts.isWatchSet = isWatchSet;
|
|
19704
19679
|
function closeFileWatcher(watcher) {
|
|
@@ -19946,7 +19921,6 @@ var ts;
|
|
|
19946
19921
|
|| kind === 114 /* SyntaxKind.VoidKeyword */
|
|
19947
19922
|
|| kind === 155 /* SyntaxKind.UndefinedKeyword */
|
|
19948
19923
|
|| kind === 144 /* SyntaxKind.NeverKeyword */
|
|
19949
|
-
|| kind === 139 /* SyntaxKind.IntrinsicKeyword */
|
|
19950
19924
|
|| kind === 230 /* SyntaxKind.ExpressionWithTypeArguments */
|
|
19951
19925
|
|| kind === 315 /* SyntaxKind.JSDocAllType */
|
|
19952
19926
|
|| kind === 316 /* SyntaxKind.JSDocUnknownType */
|
|
@@ -22258,11 +22232,6 @@ var ts;
|
|
|
22258
22232
|
}
|
|
22259
22233
|
}
|
|
22260
22234
|
ts.createParenthesizerRules = createParenthesizerRules;
|
|
22261
|
-
function castToNodeArray(nodes) {
|
|
22262
|
-
// TODO(jakebailey): Why do we need this helper? GH#49924?
|
|
22263
|
-
// Also, why can't I write `isNodeArray<T>` as an expression?
|
|
22264
|
-
return ts.cast(nodes, ts.isNodeArray);
|
|
22265
|
-
}
|
|
22266
22235
|
ts.nullParenthesizerRules = {
|
|
22267
22236
|
getParenthesizeLeftSideOfBinaryForOperator: function (_) { return ts.identity; },
|
|
22268
22237
|
getParenthesizeRightSideOfBinaryForOperator: function (_) { return ts.identity; },
|
|
@@ -22276,23 +22245,23 @@ var ts;
|
|
|
22276
22245
|
parenthesizeLeftSideOfAccess: function (expression) { return ts.cast(expression, ts.isLeftHandSideExpression); },
|
|
22277
22246
|
parenthesizeOperandOfPostfixUnary: function (operand) { return ts.cast(operand, ts.isLeftHandSideExpression); },
|
|
22278
22247
|
parenthesizeOperandOfPrefixUnary: function (operand) { return ts.cast(operand, ts.isUnaryExpression); },
|
|
22279
|
-
parenthesizeExpressionsOfCommaDelimitedList:
|
|
22248
|
+
parenthesizeExpressionsOfCommaDelimitedList: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
22280
22249
|
parenthesizeExpressionForDisallowedComma: ts.identity,
|
|
22281
22250
|
parenthesizeExpressionOfExpressionStatement: ts.identity,
|
|
22282
22251
|
parenthesizeConciseBodyOfArrowFunction: ts.identity,
|
|
22283
22252
|
parenthesizeCheckTypeOfConditionalType: ts.identity,
|
|
22284
22253
|
parenthesizeExtendsTypeOfConditionalType: ts.identity,
|
|
22285
|
-
parenthesizeConstituentTypesOfUnionType:
|
|
22254
|
+
parenthesizeConstituentTypesOfUnionType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
22286
22255
|
parenthesizeConstituentTypeOfUnionType: ts.identity,
|
|
22287
|
-
parenthesizeConstituentTypesOfIntersectionType:
|
|
22256
|
+
parenthesizeConstituentTypesOfIntersectionType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
22288
22257
|
parenthesizeConstituentTypeOfIntersectionType: ts.identity,
|
|
22289
22258
|
parenthesizeOperandOfTypeOperator: ts.identity,
|
|
22290
22259
|
parenthesizeOperandOfReadonlyTypeOperator: ts.identity,
|
|
22291
22260
|
parenthesizeNonArrayTypeOfPostfixType: ts.identity,
|
|
22292
|
-
parenthesizeElementTypesOfTupleType:
|
|
22261
|
+
parenthesizeElementTypesOfTupleType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
22293
22262
|
parenthesizeElementTypeOfTupleType: ts.identity,
|
|
22294
22263
|
parenthesizeTypeOfOptionalType: ts.identity,
|
|
22295
|
-
parenthesizeTypeArguments: function (nodes) { return nodes &&
|
|
22264
|
+
parenthesizeTypeArguments: function (nodes) { return nodes && ts.cast(nodes, ts.isNodeArray); },
|
|
22296
22265
|
parenthesizeLeadingTypeArgument: ts.identity,
|
|
22297
22266
|
};
|
|
22298
22267
|
})(ts || (ts = {}));
|
|
@@ -26989,7 +26958,7 @@ var ts;
|
|
|
26989
26958
|
clone.transformFlags = node.transformFlags;
|
|
26990
26959
|
setOriginalNode(clone, node);
|
|
26991
26960
|
for (var key in node) {
|
|
26992
|
-
if (
|
|
26961
|
+
if (ts.hasProperty(clone, key) || !ts.hasProperty(node, key)) {
|
|
26993
26962
|
continue;
|
|
26994
26963
|
}
|
|
26995
26964
|
clone[key] = node[key];
|
|
@@ -31877,7 +31846,6 @@ var ts;
|
|
|
31877
31846
|
visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
31878
31847
|
visitNode(cbNode, node.type);
|
|
31879
31848
|
}
|
|
31880
|
-
;
|
|
31881
31849
|
function forEachChildInUnionOrIntersectionType(node, cbNode, cbNodes) {
|
|
31882
31850
|
return visitNodes(cbNode, cbNodes, node.types);
|
|
31883
31851
|
}
|
|
@@ -33179,7 +33147,7 @@ var ts;
|
|
|
33179
33147
|
}
|
|
33180
33148
|
function parsePrivateIdentifier() {
|
|
33181
33149
|
var pos = getNodePos();
|
|
33182
|
-
var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.
|
|
33150
|
+
var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenValue()));
|
|
33183
33151
|
nextToken();
|
|
33184
33152
|
return finishNode(node, pos);
|
|
33185
33153
|
}
|
|
@@ -39277,8 +39245,8 @@ var ts;
|
|
|
39277
39245
|
}
|
|
39278
39246
|
}
|
|
39279
39247
|
}
|
|
39280
|
-
function moveElementEntirelyPastChangeRange(element, delta, oldText, newText, aggressiveChecks) {
|
|
39281
|
-
if (
|
|
39248
|
+
function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) {
|
|
39249
|
+
if (isArray) {
|
|
39282
39250
|
visitArray(element);
|
|
39283
39251
|
}
|
|
39284
39252
|
else {
|
|
@@ -39286,7 +39254,6 @@ var ts;
|
|
|
39286
39254
|
}
|
|
39287
39255
|
return;
|
|
39288
39256
|
function visitNode(node) {
|
|
39289
|
-
ts.Debug.type(node);
|
|
39290
39257
|
var text = "";
|
|
39291
39258
|
if (aggressiveChecks && shouldCheckNode(node)) {
|
|
39292
39259
|
text = oldText.substring(node.pos, node.end);
|
|
@@ -39310,7 +39277,6 @@ var ts;
|
|
|
39310
39277
|
checkNodePositions(node, aggressiveChecks);
|
|
39311
39278
|
}
|
|
39312
39279
|
function visitArray(array) {
|
|
39313
|
-
ts.Debug.type(array);
|
|
39314
39280
|
array._children = undefined;
|
|
39315
39281
|
ts.setTextRangePosEnd(array, array.pos + delta, array.end + delta);
|
|
39316
39282
|
for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
|
|
@@ -39416,12 +39382,11 @@ var ts;
|
|
|
39416
39382
|
visitNode(sourceFile);
|
|
39417
39383
|
return;
|
|
39418
39384
|
function visitNode(child) {
|
|
39419
|
-
ts.Debug.type(child);
|
|
39420
39385
|
ts.Debug.assert(child.pos <= child.end);
|
|
39421
39386
|
if (child.pos > changeRangeOldEnd) {
|
|
39422
39387
|
// Node is entirely past the change range. We need to move both its pos and
|
|
39423
39388
|
// end, forward or backward appropriately.
|
|
39424
|
-
moveElementEntirelyPastChangeRange(child, delta, oldText, newText, aggressiveChecks);
|
|
39389
|
+
moveElementEntirelyPastChangeRange(child, /*isArray*/ false, delta, oldText, newText, aggressiveChecks);
|
|
39425
39390
|
return;
|
|
39426
39391
|
}
|
|
39427
39392
|
// Check if the element intersects the change range. If it does, then it is not
|
|
@@ -39447,12 +39412,11 @@ var ts;
|
|
|
39447
39412
|
ts.Debug.assert(fullEnd < changeStart);
|
|
39448
39413
|
}
|
|
39449
39414
|
function visitArray(array) {
|
|
39450
|
-
ts.Debug.type(array);
|
|
39451
39415
|
ts.Debug.assert(array.pos <= array.end);
|
|
39452
39416
|
if (array.pos > changeRangeOldEnd) {
|
|
39453
39417
|
// Array is entirely after the change range. We need to move it, and move any of
|
|
39454
39418
|
// its children.
|
|
39455
|
-
moveElementEntirelyPastChangeRange(array, delta, oldText, newText, aggressiveChecks);
|
|
39419
|
+
moveElementEntirelyPastChangeRange(array, /*isArray*/ true, delta, oldText, newText, aggressiveChecks);
|
|
39456
39420
|
return;
|
|
39457
39421
|
}
|
|
39458
39422
|
// Check if the element intersects the change range. If it does, then it is not
|
|
@@ -43054,7 +43018,6 @@ var ts;
|
|
|
43054
43018
|
}
|
|
43055
43019
|
}
|
|
43056
43020
|
function specToDiagnostic(spec, disallowTrailingRecursion) {
|
|
43057
|
-
ts.Debug.assert(typeof spec === "string");
|
|
43058
43021
|
if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
|
|
43059
43022
|
return [ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
|
|
43060
43023
|
}
|
|
@@ -43198,7 +43161,7 @@ var ts;
|
|
|
43198
43161
|
function convertCompilerOptionsForTelemetry(opts) {
|
|
43199
43162
|
var out = {};
|
|
43200
43163
|
for (var key in opts) {
|
|
43201
|
-
if (
|
|
43164
|
+
if (ts.hasProperty(opts, key)) {
|
|
43202
43165
|
var type = getOptionFromName(key);
|
|
43203
43166
|
if (type !== undefined) { // Ignore unknown options
|
|
43204
43167
|
out[key] = getOptionValueWithEmptyStrings(opts[key], type);
|
|
@@ -45270,6 +45233,7 @@ var ts;
|
|
|
45270
45233
|
}
|
|
45271
45234
|
}
|
|
45272
45235
|
function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
|
|
45236
|
+
var _a;
|
|
45273
45237
|
var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));
|
|
45274
45238
|
// First look for a nested package.json, as in `node_modules/foo/bar/package.json`.
|
|
45275
45239
|
var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
|
|
@@ -45284,13 +45248,7 @@ var ts;
|
|
|
45284
45248
|
return withPackageId(packageInfo, fromDirectory);
|
|
45285
45249
|
}
|
|
45286
45250
|
}
|
|
45287
|
-
var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
|
|
45288
45251
|
var loader = function (extensions, candidate, onlyRecordFailures, state) {
|
|
45289
|
-
var _a;
|
|
45290
|
-
// package exports are higher priority than file/directory lookups (and, if there's exports present, blocks them)
|
|
45291
|
-
if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
|
|
45292
|
-
return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
45293
|
-
}
|
|
45294
45252
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
45295
45253
|
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths);
|
|
45296
45254
|
if (!pathAndExtension && packageInfo
|
|
@@ -45303,19 +45261,24 @@ var ts;
|
|
|
45303
45261
|
}
|
|
45304
45262
|
return withPackageId(packageInfo, pathAndExtension);
|
|
45305
45263
|
};
|
|
45306
|
-
|
|
45307
|
-
|
|
45308
|
-
|
|
45264
|
+
var _b = parsePackageName(moduleName), packageName = _b.packageName, rest = _b.rest;
|
|
45265
|
+
var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
|
|
45266
|
+
if (rest !== "") {
|
|
45267
|
+
// Previous `packageInfo` may have been from a nested package.json; ensure we have the one from the package root now.
|
|
45309
45268
|
packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
45310
|
-
|
|
45311
|
-
|
|
45312
|
-
|
|
45313
|
-
|
|
45314
|
-
|
|
45315
|
-
|
|
45316
|
-
|
|
45317
|
-
|
|
45318
|
-
|
|
45269
|
+
}
|
|
45270
|
+
// package exports are higher priority than file/directory/typesVersions lookups and (and, if there's exports present, blocks them)
|
|
45271
|
+
if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
|
|
45272
|
+
return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
45273
|
+
}
|
|
45274
|
+
if (rest !== "" && packageInfo && packageInfo.contents.versionPaths) {
|
|
45275
|
+
if (state.traceEnabled) {
|
|
45276
|
+
trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
|
|
45277
|
+
}
|
|
45278
|
+
var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
|
|
45279
|
+
var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
|
|
45280
|
+
if (fromPaths) {
|
|
45281
|
+
return fromPaths.value;
|
|
45319
45282
|
}
|
|
45320
45283
|
}
|
|
45321
45284
|
return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
|
|
@@ -49702,7 +49665,8 @@ var ts;
|
|
|
49702
49665
|
var emptyTypeLiteralSymbol = createSymbol(2048 /* SymbolFlags.TypeLiteral */, "__type" /* InternalSymbolName.Type */);
|
|
49703
49666
|
emptyTypeLiteralSymbol.members = ts.createSymbolTable();
|
|
49704
49667
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
49705
|
-
var
|
|
49668
|
+
var unknownEmptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
49669
|
+
var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType;
|
|
49706
49670
|
var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
49707
49671
|
emptyGenericType.instantiations = new ts.Map();
|
|
49708
49672
|
var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
@@ -49816,6 +49780,8 @@ var ts;
|
|
|
49816
49780
|
var deferredGlobalOmitSymbol;
|
|
49817
49781
|
var deferredGlobalAwaitedSymbol;
|
|
49818
49782
|
var deferredGlobalBigIntType;
|
|
49783
|
+
var deferredGlobalNaNSymbol;
|
|
49784
|
+
var deferredGlobalRecordSymbol;
|
|
49819
49785
|
var allPotentiallyUnusedIdentifiers = new ts.Map(); // key is file name
|
|
49820
49786
|
var flowLoopStart = 0;
|
|
49821
49787
|
var flowLoopCount = 0;
|
|
@@ -49900,7 +49866,7 @@ var ts;
|
|
|
49900
49866
|
if (jsxFragmentPragma) {
|
|
49901
49867
|
var chosenPragma = ts.isArray(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma;
|
|
49902
49868
|
file.localJsxFragmentFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
|
|
49903
|
-
ts.visitNode(file.localJsxFragmentFactory, markAsSynthetic
|
|
49869
|
+
ts.visitNode(file.localJsxFragmentFactory, markAsSynthetic);
|
|
49904
49870
|
if (file.localJsxFragmentFactory) {
|
|
49905
49871
|
return file.localJsxFragmentNamespace = ts.getFirstIdentifier(file.localJsxFragmentFactory).escapedText;
|
|
49906
49872
|
}
|
|
@@ -49945,7 +49911,7 @@ var ts;
|
|
|
49945
49911
|
if (jsxPragma) {
|
|
49946
49912
|
var chosenPragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma;
|
|
49947
49913
|
file.localJsxFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
|
|
49948
|
-
ts.visitNode(file.localJsxFactory, markAsSynthetic
|
|
49914
|
+
ts.visitNode(file.localJsxFactory, markAsSynthetic);
|
|
49949
49915
|
if (file.localJsxFactory) {
|
|
49950
49916
|
return file.localJsxNamespace = ts.getFirstIdentifier(file.localJsxFactory).escapedText;
|
|
49951
49917
|
}
|
|
@@ -51604,7 +51570,6 @@ var ts;
|
|
|
51604
51570
|
return valueSymbol;
|
|
51605
51571
|
}
|
|
51606
51572
|
var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName);
|
|
51607
|
-
ts.Debug.assert(valueSymbol.declarations || typeSymbol.declarations);
|
|
51608
51573
|
result.declarations = ts.deduplicate(ts.concatenate(valueSymbol.declarations, typeSymbol.declarations), ts.equateValues);
|
|
51609
51574
|
result.parent = valueSymbol.parent || typeSymbol.parent;
|
|
51610
51575
|
if (valueSymbol.valueDeclaration)
|
|
@@ -53657,7 +53622,6 @@ var ts;
|
|
|
53657
53622
|
var objectFlags = ts.getObjectFlags(type);
|
|
53658
53623
|
if (objectFlags & 4 /* ObjectFlags.Reference */) {
|
|
53659
53624
|
ts.Debug.assert(!!(type.flags & 524288 /* TypeFlags.Object */));
|
|
53660
|
-
ts.Debug.type(type);
|
|
53661
53625
|
return type.node ? visitAndTransformType(type, typeReferenceToTypeNode) : typeReferenceToTypeNode(type);
|
|
53662
53626
|
}
|
|
53663
53627
|
if (type.flags & 262144 /* TypeFlags.TypeParameter */ || objectFlags & 3 /* ObjectFlags.ClassOrInterface */) {
|
|
@@ -55116,7 +55080,7 @@ var ts;
|
|
|
55116
55080
|
}
|
|
55117
55081
|
var hadError = false;
|
|
55118
55082
|
var file = ts.getSourceFileOfNode(existing);
|
|
55119
|
-
var transformed = ts.visitNode(existing, visitExistingNodeTreeSymbols
|
|
55083
|
+
var transformed = ts.visitNode(existing, visitExistingNodeTreeSymbols);
|
|
55120
55084
|
if (hadError) {
|
|
55121
55085
|
return undefined;
|
|
55122
55086
|
}
|
|
@@ -55147,7 +55111,7 @@ var ts;
|
|
|
55147
55111
|
var typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode(node), name.escapedText);
|
|
55148
55112
|
var overrideTypeNode = typeViaParent && t.typeExpression && getTypeFromTypeNode(t.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context) : undefined;
|
|
55149
55113
|
return ts.factory.createPropertySignature(
|
|
55150
|
-
/*modifiers*/ undefined, name, t.isBracketed || t.typeExpression && ts.isJSDocOptionalType(t.typeExpression.type) ? ts.factory.createToken(57 /* SyntaxKind.QuestionToken */) : undefined, overrideTypeNode || (t.typeExpression && ts.visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols
|
|
55114
|
+
/*modifiers*/ undefined, name, t.isBracketed || t.typeExpression && ts.isJSDocOptionalType(t.typeExpression.type) ? ts.factory.createToken(57 /* SyntaxKind.QuestionToken */) : undefined, overrideTypeNode || (t.typeExpression && ts.visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols)) || ts.factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */));
|
|
55151
55115
|
}));
|
|
55152
55116
|
}
|
|
55153
55117
|
if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "") {
|
|
@@ -55158,18 +55122,18 @@ var ts;
|
|
|
55158
55122
|
/*modifiers*/ undefined, [ts.factory.createParameterDeclaration(
|
|
55159
55123
|
/*modifiers*/ undefined,
|
|
55160
55124
|
/*dotdotdotToken*/ undefined, "x",
|
|
55161
|
-
/*questionToken*/ undefined, ts.visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols
|
|
55125
|
+
/*questionToken*/ undefined, ts.visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols))], ts.visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols))]);
|
|
55162
55126
|
}
|
|
55163
55127
|
if (ts.isJSDocFunctionType(node)) {
|
|
55164
55128
|
if (ts.isJSDocConstructSignature(node)) {
|
|
55165
55129
|
var newTypeNode_1;
|
|
55166
55130
|
return ts.factory.createConstructorTypeNode(
|
|
55167
|
-
/*modifiers*/ undefined, ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols
|
|
55131
|
+
/*modifiers*/ undefined, ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.mapDefined(node.parameters, function (p, i) { return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode_1 = p.type, undefined) : ts.factory.createParameterDeclaration(
|
|
55168
55132
|
/*modifiers*/ undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols),
|
|
55169
55133
|
/*initializer*/ undefined); }), ts.visitNode(newTypeNode_1 || node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */));
|
|
55170
55134
|
}
|
|
55171
55135
|
else {
|
|
55172
|
-
return ts.factory.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols
|
|
55136
|
+
return ts.factory.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.map(node.parameters, function (p, i) { return ts.factory.createParameterDeclaration(
|
|
55173
55137
|
/*modifiers*/ undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols),
|
|
55174
55138
|
/*initializer*/ undefined); }), ts.visitNode(node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */));
|
|
55175
55139
|
}
|
|
@@ -55495,6 +55459,7 @@ var ts;
|
|
|
55495
55459
|
&& symbol.escapedName !== "export=" /* InternalSymbolName.ExportEquals */
|
|
55496
55460
|
&& !(symbol.flags & 4194304 /* SymbolFlags.Prototype */)
|
|
55497
55461
|
&& !(symbol.flags & 32 /* SymbolFlags.Class */)
|
|
55462
|
+
&& !(symbol.flags & 8192 /* SymbolFlags.Method */)
|
|
55498
55463
|
&& !isConstMergedWithNSPrintableAsSignatureMerge) {
|
|
55499
55464
|
if (propertyAsAlias) {
|
|
55500
55465
|
var createdExport = serializeMaybeAliasAssignment(symbol);
|
|
@@ -55624,7 +55589,7 @@ var ts;
|
|
|
55624
55589
|
}
|
|
55625
55590
|
}
|
|
55626
55591
|
function includePrivateSymbol(symbol) {
|
|
55627
|
-
if (ts.some(symbol.declarations, ts.
|
|
55592
|
+
if (ts.some(symbol.declarations, ts.isParameterDeclaration))
|
|
55628
55593
|
return;
|
|
55629
55594
|
ts.Debug.assertIsDefined(deferredPrivatesStack[deferredPrivatesStack.length - 1]);
|
|
55630
55595
|
getUnusedName(ts.unescapeLeadingUnderscores(symbol.escapedName), symbol); // Call to cache unique name for symbol
|
|
@@ -56011,7 +55976,7 @@ var ts;
|
|
|
56011
55976
|
case 268 /* SyntaxKind.ImportEqualsDeclaration */:
|
|
56012
55977
|
// This _specifically_ only exists to handle json declarations - where we make aliases, but since
|
|
56013
55978
|
// we emit no declarations for the json document, must not refer to it in the declarations
|
|
56014
|
-
if (target.escapedName === "export=" /* InternalSymbolName.ExportEquals */ && ts.some(target.declarations,
|
|
55979
|
+
if (target.escapedName === "export=" /* InternalSymbolName.ExportEquals */ && ts.some(target.declarations, ts.isJsonSourceFile)) {
|
|
56015
55980
|
serializeMaybeAliasAssignment(symbol);
|
|
56016
55981
|
break;
|
|
56017
55982
|
}
|
|
@@ -57176,7 +57141,6 @@ var ts;
|
|
|
57176
57141
|
return container;
|
|
57177
57142
|
}
|
|
57178
57143
|
}
|
|
57179
|
-
;
|
|
57180
57144
|
}
|
|
57181
57145
|
/** Create a synthetic property access flow node after the last statement of the file */
|
|
57182
57146
|
function getFlowTypeFromCommonJSExport(symbol) {
|
|
@@ -60306,7 +60270,7 @@ var ts;
|
|
|
60306
60270
|
var isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp);
|
|
60307
60271
|
// If the symbols are instances of one another with identical types - consider the symbols
|
|
60308
60272
|
// equivalent and just use the first one, which thus allows us to avoid eliding private
|
|
60309
|
-
// members when intersecting a (this-)instantiations of a class with
|
|
60273
|
+
// members when intersecting a (this-)instantiations of a class with its raw base or another instance
|
|
60310
60274
|
if (isInstantiation && compareProperties(singleProp, prop, function (a, b) { return a === b ? -1 /* Ternary.True */ : 0 /* Ternary.False */; }) === -1 /* Ternary.True */) {
|
|
60311
60275
|
// If we merged instantiations of a generic type, we replicate the symbol parent resetting behavior we used
|
|
60312
60276
|
// to do when we recorded multiple distinct symbols so that we still get, eg, `Array<T>.length` printed
|
|
@@ -60354,7 +60318,11 @@ var ts;
|
|
|
60354
60318
|
}
|
|
60355
60319
|
}
|
|
60356
60320
|
}
|
|
60357
|
-
if (!singleProp ||
|
|
60321
|
+
if (!singleProp ||
|
|
60322
|
+
isUnion &&
|
|
60323
|
+
(propSet || checkFlags & 48 /* CheckFlags.Partial */) &&
|
|
60324
|
+
checkFlags & (1024 /* CheckFlags.ContainsPrivate */ | 512 /* CheckFlags.ContainsProtected */) &&
|
|
60325
|
+
!(propSet && getCommonDeclarationsOfSymbols(ts.arrayFrom(propSet.values())))) {
|
|
60358
60326
|
// No property was found, or, in a union, a property has a private or protected declaration in one
|
|
60359
60327
|
// constituent, but is missing or has a different declaration in another constituent.
|
|
60360
60328
|
return undefined;
|
|
@@ -60456,6 +60424,33 @@ var ts;
|
|
|
60456
60424
|
}
|
|
60457
60425
|
return property;
|
|
60458
60426
|
}
|
|
60427
|
+
function getCommonDeclarationsOfSymbols(symbols) {
|
|
60428
|
+
var commonDeclarations;
|
|
60429
|
+
var _loop_14 = function (symbol) {
|
|
60430
|
+
if (!symbol.declarations) {
|
|
60431
|
+
return { value: undefined };
|
|
60432
|
+
}
|
|
60433
|
+
if (!commonDeclarations) {
|
|
60434
|
+
commonDeclarations = new ts.Set(symbol.declarations);
|
|
60435
|
+
return "continue";
|
|
60436
|
+
}
|
|
60437
|
+
commonDeclarations.forEach(function (declaration) {
|
|
60438
|
+
if (!ts.contains(symbol.declarations, declaration)) {
|
|
60439
|
+
commonDeclarations.delete(declaration);
|
|
60440
|
+
}
|
|
60441
|
+
});
|
|
60442
|
+
if (commonDeclarations.size === 0) {
|
|
60443
|
+
return { value: undefined };
|
|
60444
|
+
}
|
|
60445
|
+
};
|
|
60446
|
+
for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) {
|
|
60447
|
+
var symbol = symbols_3[_i];
|
|
60448
|
+
var state_4 = _loop_14(symbol);
|
|
60449
|
+
if (typeof state_4 === "object")
|
|
60450
|
+
return state_4.value;
|
|
60451
|
+
}
|
|
60452
|
+
return commonDeclarations;
|
|
60453
|
+
}
|
|
60459
60454
|
function getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment) {
|
|
60460
60455
|
var property = getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
60461
60456
|
// We need to filter out partial properties in union types
|
|
@@ -61170,7 +61165,7 @@ var ts;
|
|
|
61170
61165
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
61171
61166
|
if (indexSymbol.declarations) {
|
|
61172
61167
|
var indexInfos_4 = [];
|
|
61173
|
-
var
|
|
61168
|
+
var _loop_15 = function (declaration) {
|
|
61174
61169
|
if (declaration.parameters.length === 1) {
|
|
61175
61170
|
var parameter = declaration.parameters[0];
|
|
61176
61171
|
if (parameter.type) {
|
|
@@ -61184,7 +61179,7 @@ var ts;
|
|
|
61184
61179
|
};
|
|
61185
61180
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
61186
61181
|
var declaration = _a[_i];
|
|
61187
|
-
|
|
61182
|
+
_loop_15(declaration);
|
|
61188
61183
|
}
|
|
61189
61184
|
return indexInfos_4;
|
|
61190
61185
|
}
|
|
@@ -61201,7 +61196,7 @@ var ts;
|
|
|
61201
61196
|
var _a;
|
|
61202
61197
|
var inferences;
|
|
61203
61198
|
if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
|
|
61204
|
-
var
|
|
61199
|
+
var _loop_16 = function (declaration) {
|
|
61205
61200
|
if (declaration.parent.kind === 192 /* SyntaxKind.InferType */) {
|
|
61206
61201
|
// When an 'infer T' declaration is immediately contained in a type reference node
|
|
61207
61202
|
// (such as 'Foo<infer T>'), T's constraint is inferred from the constraint of the
|
|
@@ -61265,7 +61260,7 @@ var ts;
|
|
|
61265
61260
|
};
|
|
61266
61261
|
for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
|
|
61267
61262
|
var declaration = _b[_i];
|
|
61268
|
-
|
|
61263
|
+
_loop_16(declaration);
|
|
61269
61264
|
}
|
|
61270
61265
|
}
|
|
61271
61266
|
return inferences && getIntersectionType(inferences);
|
|
@@ -61922,6 +61917,13 @@ var ts;
|
|
|
61922
61917
|
function getGlobalBigIntType() {
|
|
61923
61918
|
return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", /*arity*/ 0, /*reportErrors*/ false))) || emptyObjectType;
|
|
61924
61919
|
}
|
|
61920
|
+
function getGlobalNaNSymbol() {
|
|
61921
|
+
return (deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol("NaN", /*reportErrors*/ false)));
|
|
61922
|
+
}
|
|
61923
|
+
function getGlobalRecordSymbol() {
|
|
61924
|
+
deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol("Record", /*arity*/ 2, /*reportErrors*/ true) || unknownSymbol);
|
|
61925
|
+
return deferredGlobalRecordSymbol === unknownSymbol ? undefined : deferredGlobalRecordSymbol;
|
|
61926
|
+
}
|
|
61925
61927
|
/**
|
|
61926
61928
|
* Instantiates a global type that is generic with some element type, and returns that instantiation.
|
|
61927
61929
|
*/
|
|
@@ -62158,7 +62160,7 @@ var ts;
|
|
|
62158
62160
|
var lastRequiredIndex = -1;
|
|
62159
62161
|
var firstRestIndex = -1;
|
|
62160
62162
|
var lastOptionalOrRestIndex = -1;
|
|
62161
|
-
var
|
|
62163
|
+
var _loop_17 = function (i) {
|
|
62162
62164
|
var type = elementTypes[i];
|
|
62163
62165
|
var flags = target.elementFlags[i];
|
|
62164
62166
|
if (flags & 8 /* ElementFlags.Variadic */) {
|
|
@@ -62188,9 +62190,9 @@ var ts;
|
|
|
62188
62190
|
}
|
|
62189
62191
|
};
|
|
62190
62192
|
for (var i = 0; i < elementTypes.length; i++) {
|
|
62191
|
-
var
|
|
62192
|
-
if (typeof
|
|
62193
|
-
return
|
|
62193
|
+
var state_5 = _loop_17(i);
|
|
62194
|
+
if (typeof state_5 === "object")
|
|
62195
|
+
return state_5.value;
|
|
62194
62196
|
}
|
|
62195
62197
|
// Turn optional elements preceding the last required element into required elements
|
|
62196
62198
|
for (var i = 0; i < lastRequiredIndex; i++) {
|
|
@@ -62218,7 +62220,7 @@ var ts;
|
|
|
62218
62220
|
if (flags & (2 /* ElementFlags.Optional */ | 4 /* ElementFlags.Rest */)) {
|
|
62219
62221
|
lastOptionalOrRestIndex = expandedFlags.length;
|
|
62220
62222
|
}
|
|
62221
|
-
expandedTypes.push(type);
|
|
62223
|
+
expandedTypes.push(flags & 2 /* ElementFlags.Optional */ ? addOptionality(type, /*isProperty*/ true) : type);
|
|
62222
62224
|
expandedFlags.push(flags);
|
|
62223
62225
|
if (expandedDeclarations && declaration) {
|
|
62224
62226
|
expandedDeclarations.push(declaration);
|
|
@@ -62384,7 +62386,7 @@ var ts;
|
|
|
62384
62386
|
var templates = ts.filter(types, isPatternLiteralType);
|
|
62385
62387
|
if (templates.length) {
|
|
62386
62388
|
var i = types.length;
|
|
62387
|
-
var
|
|
62389
|
+
var _loop_18 = function () {
|
|
62388
62390
|
i--;
|
|
62389
62391
|
var t = types[i];
|
|
62390
62392
|
if (t.flags & 128 /* TypeFlags.StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
@@ -62392,7 +62394,7 @@ var ts;
|
|
|
62392
62394
|
}
|
|
62393
62395
|
};
|
|
62394
62396
|
while (i > 0) {
|
|
62395
|
-
|
|
62397
|
+
_loop_18();
|
|
62396
62398
|
}
|
|
62397
62399
|
}
|
|
62398
62400
|
}
|
|
@@ -62469,14 +62471,14 @@ var ts;
|
|
|
62469
62471
|
var namedUnions = [];
|
|
62470
62472
|
addNamedUnions(namedUnions, types);
|
|
62471
62473
|
var reducedTypes = [];
|
|
62472
|
-
var
|
|
62474
|
+
var _loop_19 = function (t) {
|
|
62473
62475
|
if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
|
|
62474
62476
|
reducedTypes.push(t);
|
|
62475
62477
|
}
|
|
62476
62478
|
};
|
|
62477
62479
|
for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
|
|
62478
62480
|
var t = typeSet_1[_i];
|
|
62479
|
-
|
|
62481
|
+
_loop_19(t);
|
|
62480
62482
|
}
|
|
62481
62483
|
if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
|
|
62482
62484
|
return namedUnions[0];
|
|
@@ -63706,7 +63708,7 @@ var ts;
|
|
|
63706
63708
|
var result;
|
|
63707
63709
|
var extraTypes;
|
|
63708
63710
|
var tailCount = 0;
|
|
63709
|
-
var
|
|
63711
|
+
var _loop_20 = function () {
|
|
63710
63712
|
if (tailCount === 1000) {
|
|
63711
63713
|
error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
63712
63714
|
result = errorType;
|
|
@@ -63827,10 +63829,10 @@ var ts;
|
|
|
63827
63829
|
// another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
|
|
63828
63830
|
// cases we increment the tail recursion counter and stop after 1000 iterations.
|
|
63829
63831
|
while (true) {
|
|
63830
|
-
var
|
|
63831
|
-
if (typeof
|
|
63832
|
-
return
|
|
63833
|
-
if (
|
|
63832
|
+
var state_6 = _loop_20();
|
|
63833
|
+
if (typeof state_6 === "object")
|
|
63834
|
+
return state_6.value;
|
|
63835
|
+
if (state_6 === "break")
|
|
63834
63836
|
break;
|
|
63835
63837
|
}
|
|
63836
63838
|
return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
|
|
@@ -66445,7 +66447,7 @@ var ts;
|
|
|
66445
66447
|
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
|
66446
66448
|
checkTypes = reducedTarget.flags & 1048576 /* TypeFlags.Union */ ? reducedTarget.types : [reducedTarget];
|
|
66447
66449
|
}
|
|
66448
|
-
var
|
|
66450
|
+
var _loop_21 = function (prop) {
|
|
66449
66451
|
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
|
66450
66452
|
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
|
66451
66453
|
if (reportErrors) {
|
|
@@ -66508,9 +66510,9 @@ var ts;
|
|
|
66508
66510
|
};
|
|
66509
66511
|
for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
|
|
66510
66512
|
var prop = _b[_i];
|
|
66511
|
-
var
|
|
66512
|
-
if (typeof
|
|
66513
|
-
return
|
|
66513
|
+
var state_7 = _loop_21(prop);
|
|
66514
|
+
if (typeof state_7 === "object")
|
|
66515
|
+
return state_7.value;
|
|
66514
66516
|
}
|
|
66515
66517
|
return false;
|
|
66516
66518
|
}
|
|
@@ -67501,11 +67503,11 @@ var ts;
|
|
|
67501
67503
|
// constituents of 'target'. If any combination does not have a match then 'source' is not relatable.
|
|
67502
67504
|
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
|
67503
67505
|
var matchingTypes = [];
|
|
67504
|
-
var
|
|
67506
|
+
var _loop_22 = function (combination) {
|
|
67505
67507
|
var hasMatch = false;
|
|
67506
67508
|
outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
|
|
67507
67509
|
var type = _d[_c];
|
|
67508
|
-
var
|
|
67510
|
+
var _loop_23 = function (i) {
|
|
67509
67511
|
var sourceProperty = sourcePropertiesFiltered[i];
|
|
67510
67512
|
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
|
67511
67513
|
if (!targetProperty)
|
|
@@ -67521,8 +67523,8 @@ var ts;
|
|
|
67521
67523
|
}
|
|
67522
67524
|
};
|
|
67523
67525
|
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
|
67524
|
-
var
|
|
67525
|
-
switch (
|
|
67526
|
+
var state_9 = _loop_23(i);
|
|
67527
|
+
switch (state_9) {
|
|
67526
67528
|
case "continue-outer": continue outer;
|
|
67527
67529
|
}
|
|
67528
67530
|
}
|
|
@@ -67535,9 +67537,9 @@ var ts;
|
|
|
67535
67537
|
};
|
|
67536
67538
|
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
|
67537
67539
|
var combination = discriminantCombinations_1[_a];
|
|
67538
|
-
var
|
|
67539
|
-
if (typeof
|
|
67540
|
-
return
|
|
67540
|
+
var state_8 = _loop_22(combination);
|
|
67541
|
+
if (typeof state_8 === "object")
|
|
67542
|
+
return state_8.value;
|
|
67541
67543
|
}
|
|
67542
67544
|
// Compare the remaining non-discriminant properties of each match.
|
|
67543
67545
|
var result = -1 /* Ternary.True */;
|
|
@@ -68242,7 +68244,7 @@ var ts;
|
|
|
68242
68244
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* tracing.Phase.CheckTypes */, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
68243
68245
|
links.variances = ts.emptyArray;
|
|
68244
68246
|
var variances = [];
|
|
68245
|
-
var
|
|
68247
|
+
var _loop_24 = function (tp) {
|
|
68246
68248
|
var modifiers = getVarianceModifiers(tp);
|
|
68247
68249
|
var variance = modifiers & 65536 /* ModifierFlags.Out */ ?
|
|
68248
68250
|
modifiers & 32768 /* ModifierFlags.In */ ? 0 /* VarianceFlags.Invariant */ : 1 /* VarianceFlags.Covariant */ :
|
|
@@ -68280,7 +68282,7 @@ var ts;
|
|
|
68280
68282
|
};
|
|
68281
68283
|
for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
|
|
68282
68284
|
var tp = typeParameters_2[_i];
|
|
68283
|
-
|
|
68285
|
+
_loop_24(tp);
|
|
68284
68286
|
}
|
|
68285
68287
|
links.variances = variances;
|
|
68286
68288
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
|
|
@@ -68872,7 +68874,8 @@ var ts;
|
|
|
68872
68874
|
function getOptionalType(type, isProperty) {
|
|
68873
68875
|
if (isProperty === void 0) { isProperty = false; }
|
|
68874
68876
|
ts.Debug.assert(strictNullChecks);
|
|
68875
|
-
|
|
68877
|
+
var missingOrUndefined = isProperty ? missingType : undefinedType;
|
|
68878
|
+
return type.flags & 32768 /* TypeFlags.Undefined */ || type.flags & 1048576 /* TypeFlags.Union */ && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
|
|
68876
68879
|
}
|
|
68877
68880
|
function getGlobalNonNullableTypeInstantiation(type) {
|
|
68878
68881
|
if (!deferredGlobalNonNullableTypeAlias) {
|
|
@@ -70237,7 +70240,7 @@ var ts;
|
|
|
70237
70240
|
// upon instantiation, would collapse all the placeholders to just 'string', and an assignment check might
|
|
70238
70241
|
// succeed. That would be a pointless and confusing outcome.
|
|
70239
70242
|
if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
|
|
70240
|
-
var
|
|
70243
|
+
var _loop_25 = function (i) {
|
|
70241
70244
|
var source_1 = matches ? matches[i] : neverType;
|
|
70242
70245
|
var target_3 = types[i];
|
|
70243
70246
|
// If we are inferring from a string literal type to a type variable whose constraint includes one of the
|
|
@@ -70287,7 +70290,7 @@ var ts;
|
|
|
70287
70290
|
inferFromTypes(source_1, target_3);
|
|
70288
70291
|
};
|
|
70289
70292
|
for (var i = 0; i < types.length; i++) {
|
|
70290
|
-
|
|
70293
|
+
_loop_25(i);
|
|
70291
70294
|
}
|
|
70292
70295
|
}
|
|
70293
70296
|
}
|
|
@@ -70751,7 +70754,7 @@ var ts;
|
|
|
70751
70754
|
return name;
|
|
70752
70755
|
}
|
|
70753
70756
|
}
|
|
70754
|
-
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
70757
|
+
if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
|
|
70755
70758
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
70756
70759
|
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
70757
70760
|
}
|
|
@@ -70811,7 +70814,7 @@ var ts;
|
|
|
70811
70814
|
function mapTypesByKeyProperty(types, name) {
|
|
70812
70815
|
var map = new ts.Map();
|
|
70813
70816
|
var count = 0;
|
|
70814
|
-
var
|
|
70817
|
+
var _loop_26 = function (type) {
|
|
70815
70818
|
if (type.flags & (524288 /* TypeFlags.Object */ | 2097152 /* TypeFlags.Intersection */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */)) {
|
|
70816
70819
|
var discriminant = getTypeOfPropertyOfType(type, name);
|
|
70817
70820
|
if (discriminant) {
|
|
@@ -70837,9 +70840,9 @@ var ts;
|
|
|
70837
70840
|
};
|
|
70838
70841
|
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
70839
70842
|
var type = types_15[_i];
|
|
70840
|
-
var
|
|
70841
|
-
if (typeof
|
|
70842
|
-
return
|
|
70843
|
+
var state_10 = _loop_26(type);
|
|
70844
|
+
if (typeof state_10 === "object")
|
|
70845
|
+
return state_10.value;
|
|
70843
70846
|
}
|
|
70844
70847
|
return count >= 10 && count * 2 >= types.length ? map : undefined;
|
|
70845
70848
|
}
|
|
@@ -72238,18 +72241,26 @@ var ts;
|
|
|
72238
72241
|
}
|
|
72239
72242
|
function isTypePresencePossible(type, propName, assumeTrue) {
|
|
72240
72243
|
var prop = getPropertyOfType(type, propName);
|
|
72241
|
-
|
|
72242
|
-
|
|
72243
|
-
|
|
72244
|
-
|
|
72245
|
-
|
|
72246
|
-
|
|
72247
|
-
|
|
72248
|
-
|
|
72249
|
-
|
|
72250
|
-
|
|
72244
|
+
return prop ?
|
|
72245
|
+
!!(prop.flags & 16777216 /* SymbolFlags.Optional */) || assumeTrue :
|
|
72246
|
+
!!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
|
|
72247
|
+
}
|
|
72248
|
+
function narrowByInKeyword(type, nameType, assumeTrue) {
|
|
72249
|
+
var name = getPropertyNameFromType(nameType);
|
|
72250
|
+
var isKnownProperty = someType(type, function (t) { return isTypePresencePossible(t, name, /*assumeTrue*/ true); });
|
|
72251
|
+
if (isKnownProperty) {
|
|
72252
|
+
// If the check is for a known property (i.e. a property declared in some constituent of
|
|
72253
|
+
// the target type), we filter the target type by presence of absence of the property.
|
|
72251
72254
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
72252
72255
|
}
|
|
72256
|
+
if (assumeTrue) {
|
|
72257
|
+
// If the check is for an unknown property, we intersect the target type with `Record<X, unknown>`,
|
|
72258
|
+
// where X is the name of the property.
|
|
72259
|
+
var recordSymbol = getGlobalRecordSymbol();
|
|
72260
|
+
if (recordSymbol) {
|
|
72261
|
+
return getIntersectionType([type, getTypeAliasInstantiation(recordSymbol, [nameType, unknownType])]);
|
|
72262
|
+
}
|
|
72263
|
+
}
|
|
72253
72264
|
return type;
|
|
72254
72265
|
}
|
|
72255
72266
|
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
|
|
@@ -72308,15 +72319,14 @@ var ts;
|
|
|
72308
72319
|
return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
|
|
72309
72320
|
}
|
|
72310
72321
|
var target = getReferenceCandidate(expr.right);
|
|
72311
|
-
var leftType =
|
|
72312
|
-
if (leftType.flags &
|
|
72313
|
-
var name = ts.escapeLeadingUnderscores(leftType.value);
|
|
72322
|
+
var leftType = getTypeOfExpression(expr.left);
|
|
72323
|
+
if (leftType.flags & 8576 /* TypeFlags.StringOrNumberLiteralOrUnique */) {
|
|
72314
72324
|
if (containsMissingType(type) && ts.isAccessExpression(reference) && isMatchingReference(reference.expression, target) &&
|
|
72315
|
-
getAccessedPropertyName(reference) ===
|
|
72325
|
+
getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
|
|
72316
72326
|
return getTypeWithFacts(type, assumeTrue ? 524288 /* TypeFacts.NEUndefined */ : 65536 /* TypeFacts.EQUndefined */);
|
|
72317
72327
|
}
|
|
72318
72328
|
if (isMatchingReference(reference, target)) {
|
|
72319
|
-
return narrowByInKeyword(type,
|
|
72329
|
+
return narrowByInKeyword(type, leftType, assumeTrue);
|
|
72320
72330
|
}
|
|
72321
72331
|
}
|
|
72322
72332
|
break;
|
|
@@ -74578,7 +74588,7 @@ var ts;
|
|
|
74578
74588
|
return left === right || !left ? left
|
|
74579
74589
|
: compareTypeParametersIdentical(left.typeParameters, right.typeParameters) ? combineSignaturesOfIntersectionMembers(left, right)
|
|
74580
74590
|
: undefined;
|
|
74581
|
-
})
|
|
74591
|
+
})
|
|
74582
74592
|
: undefined;
|
|
74583
74593
|
}
|
|
74584
74594
|
function combineIntersectionThisParam(left, right, mapper) {
|
|
@@ -76486,7 +76496,6 @@ var ts;
|
|
|
76486
76496
|
}
|
|
76487
76497
|
return false;
|
|
76488
76498
|
}
|
|
76489
|
-
;
|
|
76490
76499
|
var suggestedMethod = ts.isAssignmentTarget(expr) ? "set" : "get";
|
|
76491
76500
|
if (!hasProp(suggestedMethod)) {
|
|
76492
76501
|
return undefined;
|
|
@@ -77288,7 +77297,7 @@ var ts;
|
|
|
77288
77297
|
if (spreadIndex >= 0) {
|
|
77289
77298
|
// Create synthetic arguments from spreads of tuple types.
|
|
77290
77299
|
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
|
77291
|
-
var
|
|
77300
|
+
var _loop_27 = function (i) {
|
|
77292
77301
|
var arg = args[i];
|
|
77293
77302
|
// We can call checkExpressionCached because spread expressions never have a contextual type.
|
|
77294
77303
|
var spreadType = arg.kind === 227 /* SyntaxKind.SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
@@ -77305,7 +77314,7 @@ var ts;
|
|
|
77305
77314
|
}
|
|
77306
77315
|
};
|
|
77307
77316
|
for (var i = spreadIndex; i < args.length; i++) {
|
|
77308
|
-
|
|
77317
|
+
_loop_27(i);
|
|
77309
77318
|
}
|
|
77310
77319
|
return effectiveArgs_1;
|
|
77311
77320
|
}
|
|
@@ -77634,7 +77643,7 @@ var ts;
|
|
|
77634
77643
|
var min_3 = Number.MAX_VALUE;
|
|
77635
77644
|
var minIndex = 0;
|
|
77636
77645
|
var i_1 = 0;
|
|
77637
|
-
var
|
|
77646
|
+
var _loop_28 = function (c) {
|
|
77638
77647
|
var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
|
|
77639
77648
|
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* CheckMode.Normal */, /*reportErrors*/ true, chain_2);
|
|
77640
77649
|
if (diags_2) {
|
|
@@ -77652,7 +77661,7 @@ var ts;
|
|
|
77652
77661
|
};
|
|
77653
77662
|
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
|
77654
77663
|
var c = candidatesForArgumentError_1[_a];
|
|
77655
|
-
|
|
77664
|
+
_loop_28(c);
|
|
77656
77665
|
}
|
|
77657
77666
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
77658
77667
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
@@ -77810,7 +77819,7 @@ var ts;
|
|
|
77810
77819
|
}
|
|
77811
77820
|
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
|
77812
77821
|
var parameters = [];
|
|
77813
|
-
var
|
|
77822
|
+
var _loop_29 = function (i) {
|
|
77814
77823
|
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
|
77815
77824
|
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
|
77816
77825
|
i < s.parameters.length ? s.parameters[i] : undefined; });
|
|
@@ -77818,7 +77827,7 @@ var ts;
|
|
|
77818
77827
|
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
|
77819
77828
|
};
|
|
77820
77829
|
for (var i = 0; i < maxNonRestParam; i++) {
|
|
77821
|
-
|
|
77830
|
+
_loop_29(i);
|
|
77822
77831
|
}
|
|
77823
77832
|
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
|
77824
77833
|
var flags = 0 /* SignatureFlags.None */;
|
|
@@ -80057,6 +80066,9 @@ var ts;
|
|
|
80057
80066
|
}
|
|
80058
80067
|
return booleanType;
|
|
80059
80068
|
}
|
|
80069
|
+
function hasEmptyObjectIntersection(type) {
|
|
80070
|
+
return someType(type, function (t) { return t === unknownEmptyObjectType || !!(t.flags & 2097152 /* TypeFlags.Intersection */) && ts.some(t.types, isEmptyAnonymousObjectType); });
|
|
80071
|
+
}
|
|
80060
80072
|
function checkInExpression(left, right, leftType, rightType) {
|
|
80061
80073
|
if (leftType === silentNeverType || rightType === silentNeverType) {
|
|
80062
80074
|
return silentNeverType;
|
|
@@ -80073,40 +80085,20 @@ var ts;
|
|
|
80073
80085
|
}
|
|
80074
80086
|
}
|
|
80075
80087
|
else {
|
|
80076
|
-
|
|
80077
|
-
|
|
80078
|
-
|
|
80079
|
-
|
|
80080
|
-
|
|
80081
|
-
|
|
80088
|
+
// The type of the lef operand must be assignable to string, number, or symbol.
|
|
80089
|
+
checkTypeAssignableTo(checkNonNullType(leftType, left), stringNumberSymbolType, left);
|
|
80090
|
+
}
|
|
80091
|
+
// The type of the right operand must be assignable to 'object'.
|
|
80092
|
+
if (checkTypeAssignableTo(checkNonNullType(rightType, right), nonPrimitiveType, right)) {
|
|
80093
|
+
// The {} type is assignable to the object type, yet {} might represent a primitive type. Here we
|
|
80094
|
+
// detect and error on {} that results from narrowing the unknown type, as well as intersections
|
|
80095
|
+
// that include {} (we know that the other types in such intersections are assignable to object
|
|
80096
|
+
// since we already checked for that).
|
|
80097
|
+
if (hasEmptyObjectIntersection(rightType)) {
|
|
80098
|
+
error(right, ts.Diagnostics.Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator, typeToString(rightType));
|
|
80082
80099
|
}
|
|
80083
80100
|
}
|
|
80084
|
-
rightType = checkNonNullType(rightType, right);
|
|
80085
|
-
// TypeScript 1.0 spec (April 2014): 4.15.5
|
|
80086
|
-
// The in operator requires the right operand to be
|
|
80087
|
-
//
|
|
80088
|
-
// 1. assignable to the non-primitive type,
|
|
80089
|
-
// 2. an unconstrained type parameter,
|
|
80090
|
-
// 3. a union or intersection including one or more type parameters, whose constituents are all assignable to the
|
|
80091
|
-
// the non-primitive type, or are unconstrainted type parameters, or have constraints assignable to the
|
|
80092
|
-
// non-primitive type, or
|
|
80093
|
-
// 4. a type parameter whose constraint is
|
|
80094
|
-
// i. an object type,
|
|
80095
|
-
// ii. the non-primitive type, or
|
|
80096
|
-
// iii. a union or intersection with at least one constituent assignable to an object or non-primitive type.
|
|
80097
|
-
//
|
|
80098
|
-
// The divergent behavior for type parameters and unions containing type parameters is a workaround for type
|
|
80099
|
-
// parameters not being narrowable. If the right operand is a concrete type, we can error if there is any chance
|
|
80100
|
-
// it is a primitive. But if the operand is a type parameter, it cannot be narrowed, so we don't issue an error
|
|
80101
|
-
// unless *all* instantiations would result in an error.
|
|
80102
|
-
//
|
|
80103
80101
|
// The result is always of the Boolean primitive type.
|
|
80104
|
-
var rightTypeConstraint = getConstraintOfType(rightType);
|
|
80105
|
-
if (!allTypesAssignableToKind(rightType, 67108864 /* TypeFlags.NonPrimitive */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */) ||
|
|
80106
|
-
rightTypeConstraint && (isTypeAssignableToKind(rightType, 3145728 /* TypeFlags.UnionOrIntersection */) && !allTypesAssignableToKind(rightTypeConstraint, 67108864 /* TypeFlags.NonPrimitive */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */) ||
|
|
80107
|
-
!maybeTypeOfKind(rightTypeConstraint, 67108864 /* TypeFlags.NonPrimitive */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */ | 524288 /* TypeFlags.Object */))) {
|
|
80108
|
-
error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_not_be_a_primitive);
|
|
80109
|
-
}
|
|
80110
80102
|
return booleanType;
|
|
80111
80103
|
}
|
|
80112
80104
|
function checkObjectLiteralAssignment(node, sourceType, rightIsThis) {
|
|
@@ -80617,6 +80609,7 @@ var ts;
|
|
|
80617
80609
|
var eqType = operator === 34 /* SyntaxKind.EqualsEqualsToken */ || operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */;
|
|
80618
80610
|
error(errorNode, ts.Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
|
|
80619
80611
|
}
|
|
80612
|
+
checkNaNEquality(errorNode, operator, left, right);
|
|
80620
80613
|
reportOperatorErrorUnless(function (left, right) { return isTypeEqualityComparableTo(left, right) || isTypeEqualityComparableTo(right, left); });
|
|
80621
80614
|
return booleanType;
|
|
80622
80615
|
case 102 /* SyntaxKind.InstanceOfKeyword */:
|
|
@@ -80822,6 +80815,26 @@ var ts;
|
|
|
80822
80815
|
return undefined;
|
|
80823
80816
|
}
|
|
80824
80817
|
}
|
|
80818
|
+
function checkNaNEquality(errorNode, operator, left, right) {
|
|
80819
|
+
var isLeftNaN = isGlobalNaN(ts.skipParentheses(left));
|
|
80820
|
+
var isRightNaN = isGlobalNaN(ts.skipParentheses(right));
|
|
80821
|
+
if (isLeftNaN || isRightNaN) {
|
|
80822
|
+
var err = error(errorNode, ts.Diagnostics.This_condition_will_always_return_0, ts.tokenToString(operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 34 /* SyntaxKind.EqualsEqualsToken */ ? 95 /* SyntaxKind.FalseKeyword */ : 110 /* SyntaxKind.TrueKeyword */));
|
|
80823
|
+
if (isLeftNaN && isRightNaN)
|
|
80824
|
+
return;
|
|
80825
|
+
var operatorString = operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */ || operator === 35 /* SyntaxKind.ExclamationEqualsToken */ ? ts.tokenToString(53 /* SyntaxKind.ExclamationToken */) : "";
|
|
80826
|
+
var location = isLeftNaN ? right : left;
|
|
80827
|
+
var expression = ts.skipParentheses(location);
|
|
80828
|
+
ts.addRelatedInfo(err, ts.createDiagnosticForNode(location, ts.Diagnostics.Did_you_mean_0, "".concat(operatorString, "Number.isNaN(").concat(ts.isEntityNameExpression(expression) ? ts.entityNameToString(expression) : "...", ")")));
|
|
80829
|
+
}
|
|
80830
|
+
}
|
|
80831
|
+
function isGlobalNaN(expr) {
|
|
80832
|
+
if (ts.isIdentifier(expr) && expr.escapedText === "NaN") {
|
|
80833
|
+
var globalNaNSymbol = getGlobalNaNSymbol();
|
|
80834
|
+
return !!globalNaNSymbol && globalNaNSymbol === getResolvedSymbol(expr);
|
|
80835
|
+
}
|
|
80836
|
+
return false;
|
|
80837
|
+
}
|
|
80825
80838
|
}
|
|
80826
80839
|
function getBaseTypesIfUnrelated(leftType, rightType, isRelated) {
|
|
80827
80840
|
var effectiveLeft = leftType;
|
|
@@ -81859,7 +81872,7 @@ var ts;
|
|
|
81859
81872
|
var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
|
|
81860
81873
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
81861
81874
|
var indexSignatureMap_1 = new ts.Map();
|
|
81862
|
-
var
|
|
81875
|
+
var _loop_30 = function (declaration) {
|
|
81863
81876
|
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
|
81864
81877
|
forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
|
|
81865
81878
|
var entry = indexSignatureMap_1.get(getTypeId(type));
|
|
@@ -81874,7 +81887,7 @@ var ts;
|
|
|
81874
81887
|
};
|
|
81875
81888
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
81876
81889
|
var declaration = _a[_i];
|
|
81877
|
-
|
|
81890
|
+
_loop_30(declaration);
|
|
81878
81891
|
}
|
|
81879
81892
|
indexSignatureMap_1.forEach(function (entry) {
|
|
81880
81893
|
if (entry.declarations.length > 1) {
|
|
@@ -85474,7 +85487,7 @@ var ts;
|
|
|
85474
85487
|
var propDeclaration = declaration && declaration.kind === 223 /* SyntaxKind.BinaryExpression */ ||
|
|
85475
85488
|
name && name.kind === 164 /* SyntaxKind.ComputedPropertyName */ ? declaration : undefined;
|
|
85476
85489
|
var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
|
|
85477
|
-
var
|
|
85490
|
+
var _loop_31 = function (info) {
|
|
85478
85491
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
85479
85492
|
// We check only when (a) the property is declared in the containing type, or (b) the applicable index signature is declared
|
|
85480
85493
|
// in the containing type, or (c) the containing type is an interface and no base interface contains both the property and
|
|
@@ -85491,7 +85504,7 @@ var ts;
|
|
|
85491
85504
|
};
|
|
85492
85505
|
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
85493
85506
|
var info = indexInfos_9[_i];
|
|
85494
|
-
|
|
85507
|
+
_loop_31(info);
|
|
85495
85508
|
}
|
|
85496
85509
|
}
|
|
85497
85510
|
function checkIndexConstraintForIndexSignature(type, checkInfo) {
|
|
@@ -85499,7 +85512,7 @@ var ts;
|
|
|
85499
85512
|
var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
|
|
85500
85513
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* ObjectFlags.Interface */ ? ts.getDeclarationOfKind(type.symbol, 261 /* SyntaxKind.InterfaceDeclaration */) : undefined;
|
|
85501
85514
|
var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
|
|
85502
|
-
var
|
|
85515
|
+
var _loop_32 = function (info) {
|
|
85503
85516
|
if (info === checkInfo)
|
|
85504
85517
|
return "continue";
|
|
85505
85518
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
@@ -85514,7 +85527,7 @@ var ts;
|
|
|
85514
85527
|
};
|
|
85515
85528
|
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
85516
85529
|
var info = indexInfos_10[_i];
|
|
85517
|
-
|
|
85530
|
+
_loop_32(info);
|
|
85518
85531
|
}
|
|
85519
85532
|
}
|
|
85520
85533
|
function checkTypeNameIsReserved(name, message) {
|
|
@@ -85834,7 +85847,7 @@ var ts;
|
|
|
85834
85847
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
85835
85848
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
85836
85849
|
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
85837
|
-
var
|
|
85850
|
+
var _loop_33 = function (member) {
|
|
85838
85851
|
if (ts.hasAmbientModifier(member)) {
|
|
85839
85852
|
return "continue";
|
|
85840
85853
|
}
|
|
@@ -85851,7 +85864,7 @@ var ts;
|
|
|
85851
85864
|
};
|
|
85852
85865
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
85853
85866
|
var member = _a[_i];
|
|
85854
|
-
|
|
85867
|
+
_loop_33(member);
|
|
85855
85868
|
}
|
|
85856
85869
|
}
|
|
85857
85870
|
/**
|
|
@@ -85939,7 +85952,7 @@ var ts;
|
|
|
85939
85952
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
85940
85953
|
// iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
|
|
85941
85954
|
var issuedMemberError = false;
|
|
85942
|
-
var
|
|
85955
|
+
var _loop_34 = function (member) {
|
|
85943
85956
|
if (ts.isStatic(member)) {
|
|
85944
85957
|
return "continue";
|
|
85945
85958
|
}
|
|
@@ -85958,7 +85971,7 @@ var ts;
|
|
|
85958
85971
|
};
|
|
85959
85972
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
85960
85973
|
var member = _a[_i];
|
|
85961
|
-
|
|
85974
|
+
_loop_34(member);
|
|
85962
85975
|
}
|
|
85963
85976
|
if (!issuedMemberError) {
|
|
85964
85977
|
// check again with diagnostics to generate a less-specific error
|
|
@@ -86029,7 +86042,7 @@ var ts;
|
|
|
86029
86042
|
var _a, _b, _c, _d;
|
|
86030
86043
|
// NOTE: assignability is checked in checkClassDeclaration
|
|
86031
86044
|
var baseProperties = getPropertiesOfType(baseType);
|
|
86032
|
-
var
|
|
86045
|
+
var _loop_35 = function (baseProperty) {
|
|
86033
86046
|
var base = getTargetSymbol(baseProperty);
|
|
86034
86047
|
if (base.flags & 4194304 /* SymbolFlags.Prototype */) {
|
|
86035
86048
|
return "continue";
|
|
@@ -86139,8 +86152,8 @@ var ts;
|
|
|
86139
86152
|
};
|
|
86140
86153
|
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
86141
86154
|
var baseProperty = baseProperties_1[_i];
|
|
86142
|
-
var
|
|
86143
|
-
switch (
|
|
86155
|
+
var state_11 = _loop_35(baseProperty);
|
|
86156
|
+
switch (state_11) {
|
|
86144
86157
|
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
86145
86158
|
}
|
|
86146
86159
|
}
|
|
@@ -91116,27 +91129,17 @@ var ts;
|
|
|
91116
91129
|
})(ts || (ts = {}));
|
|
91117
91130
|
var ts;
|
|
91118
91131
|
(function (ts) {
|
|
91119
|
-
// TODO(jakebailey): include type guard and non-type guard variants on visitNode and visitNodes
|
|
91120
91132
|
var _a;
|
|
91121
|
-
/**
|
|
91122
|
-
* Visits a Node using the supplied visitor, possibly returning a new Node in its place.
|
|
91123
|
-
*
|
|
91124
|
-
* @param node The Node to visit.
|
|
91125
|
-
* @param visitor The callback used to visit the Node.
|
|
91126
|
-
* @param test A callback to execute to verify the Node is valid.
|
|
91127
|
-
* @param lift An optional callback to execute to lift a NodeArray into a valid Node.
|
|
91128
|
-
*/
|
|
91129
91133
|
function visitNode(node, visitor, test, lift) {
|
|
91130
|
-
if (node === undefined) {
|
|
91131
|
-
|
|
91134
|
+
if (node === undefined || visitor === undefined) {
|
|
91135
|
+
return node;
|
|
91136
|
+
}
|
|
91137
|
+
var visited = visitor(node);
|
|
91138
|
+
if (visited === node) {
|
|
91132
91139
|
return node;
|
|
91133
91140
|
}
|
|
91134
|
-
var visited = visitor ? visitor(node) : node;
|
|
91135
91141
|
var visitedNode;
|
|
91136
91142
|
if (visited === undefined) {
|
|
91137
|
-
// If the visited node is undefined, then the visitor must have returned undefined,
|
|
91138
|
-
// so the visitor must have been declared as able to return undefined, so TOut must be
|
|
91139
|
-
// potentially undefined.
|
|
91140
91143
|
return undefined;
|
|
91141
91144
|
}
|
|
91142
91145
|
else if (ts.isArray(visited)) {
|
|
@@ -91149,7 +91152,6 @@ var ts;
|
|
|
91149
91152
|
return visitedNode;
|
|
91150
91153
|
}
|
|
91151
91154
|
ts.visitNode = visitNode;
|
|
91152
|
-
(function (_) { })(visitNode); // Check that visitNode is a NodeVisitor.
|
|
91153
91155
|
/**
|
|
91154
91156
|
* Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
|
|
91155
91157
|
*
|
|
@@ -91160,8 +91162,7 @@ var ts;
|
|
|
91160
91162
|
* @param count An optional value indicating the maximum number of nodes to visit.
|
|
91161
91163
|
*/
|
|
91162
91164
|
function visitNodes(nodes, visitor, test, start, count) {
|
|
91163
|
-
if (nodes === undefined) {
|
|
91164
|
-
// If the input type is undefined, then the output type can be undefined.
|
|
91165
|
+
if (nodes === undefined || visitor === undefined) {
|
|
91165
91166
|
return nodes;
|
|
91166
91167
|
}
|
|
91167
91168
|
// Ensure start and count have valid values
|
|
@@ -91192,17 +91193,11 @@ var ts;
|
|
|
91192
91193
|
ts.setTextRangePosEnd(updatedArray, pos, end);
|
|
91193
91194
|
return updatedArray;
|
|
91194
91195
|
}
|
|
91195
|
-
// If we are here, updated === nodes. This means that it's still a NodeArray,
|
|
91196
|
-
// and also that its contents passed the tests in visitArrayWorker, so has contents
|
|
91197
|
-
// of type TOut.
|
|
91198
91196
|
return nodes;
|
|
91199
91197
|
}
|
|
91200
91198
|
ts.visitNodes = visitNodes;
|
|
91201
|
-
(function (_) { })(visitNodes); // Check that visitNode is a NodeVisitor.
|
|
91202
|
-
/* @internal */
|
|
91203
91199
|
function visitArray(nodes, visitor, test, start, count) {
|
|
91204
91200
|
if (nodes === undefined) {
|
|
91205
|
-
// If the input type is undefined, then the output type can be undefined.
|
|
91206
91201
|
return nodes;
|
|
91207
91202
|
}
|
|
91208
91203
|
// Ensure start and count have valid values
|
|
@@ -91227,7 +91222,7 @@ var ts;
|
|
|
91227
91222
|
// Visit each original node.
|
|
91228
91223
|
for (var i = 0; i < count; i++) {
|
|
91229
91224
|
var node = nodes[i + start];
|
|
91230
|
-
var visited = node !== undefined ?
|
|
91225
|
+
var visited = node !== undefined ? visitor(node) : undefined;
|
|
91231
91226
|
if (updated !== undefined || visited === undefined || visited !== node) {
|
|
91232
91227
|
if (updated === undefined) {
|
|
91233
91228
|
// Ensure we have a copy of `nodes`, up to the current index.
|
|
@@ -91237,20 +91232,18 @@ var ts;
|
|
|
91237
91232
|
if (ts.isArray(visited)) {
|
|
91238
91233
|
for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) {
|
|
91239
91234
|
var visitedNode = visited_1[_i];
|
|
91240
|
-
|
|
91235
|
+
void ts.Debug.assertNode(visitedNode, test);
|
|
91241
91236
|
updated.push(visitedNode);
|
|
91242
91237
|
}
|
|
91243
91238
|
}
|
|
91244
91239
|
else {
|
|
91245
|
-
|
|
91240
|
+
void ts.Debug.assertNode(visited, test);
|
|
91246
91241
|
updated.push(visited);
|
|
91247
91242
|
}
|
|
91248
91243
|
}
|
|
91249
91244
|
}
|
|
91250
91245
|
}
|
|
91251
|
-
|
|
91252
|
-
ts.Debug.assertEachNode(result, test);
|
|
91253
|
-
return result;
|
|
91246
|
+
return updated !== null && updated !== void 0 ? updated : nodes;
|
|
91254
91247
|
}
|
|
91255
91248
|
/**
|
|
91256
91249
|
* Starts a new lexical environment and visits a statement list, ending the lexical environment
|
|
@@ -91271,7 +91264,7 @@ var ts;
|
|
|
91271
91264
|
context.startLexicalEnvironment();
|
|
91272
91265
|
if (nodes) {
|
|
91273
91266
|
context.setLexicalEnvironmentFlags(1 /* LexicalEnvironmentFlags.InParameters */, true);
|
|
91274
|
-
updated = nodesVisitor(nodes, visitor, ts.
|
|
91267
|
+
updated = nodesVisitor(nodes, visitor, ts.isParameterDeclaration);
|
|
91275
91268
|
// As of ES2015, any runtime execution of that occurs in for a parameter (such as evaluating an
|
|
91276
91269
|
// initializer or a binding pattern), occurs in its own lexical scope. As a result, any expression
|
|
91277
91270
|
// that we might transform that introduces a temporary variable would fail as the temporary variable
|
|
@@ -91354,7 +91347,6 @@ var ts;
|
|
|
91354
91347
|
if (nodeVisitor === void 0) { nodeVisitor = visitNode; }
|
|
91355
91348
|
context.startBlockScope();
|
|
91356
91349
|
var updated = nodeVisitor(body, visitor, ts.isStatement, context.factory.liftToBlock);
|
|
91357
|
-
ts.Debug.assert(updated);
|
|
91358
91350
|
var declarations = context.endBlockScope();
|
|
91359
91351
|
if (ts.some(declarations)) {
|
|
91360
91352
|
if (ts.isBlock(updated)) {
|
|
@@ -91394,23 +91386,23 @@ var ts;
|
|
|
91394
91386
|
return context.factory.updateTypeParameterDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.constraint, visitor, ts.isTypeNode), nodeVisitor(node.default, visitor, ts.isTypeNode));
|
|
91395
91387
|
},
|
|
91396
91388
|
_a[166 /* SyntaxKind.Parameter */] = function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
|
|
91397
|
-
return context.factory.updateParameterDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isDotDotDotToken),
|
|
91389
|
+
return context.factory.updateParameterDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isDotDotDotToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91398
91390
|
},
|
|
91399
91391
|
_a[167 /* SyntaxKind.Decorator */] = function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91400
91392
|
return context.factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
91401
91393
|
},
|
|
91402
91394
|
// Type elements
|
|
91403
91395
|
_a[168 /* SyntaxKind.PropertySignature */] = function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
|
|
91404
|
-
return context.factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.
|
|
91396
|
+
return context.factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91405
91397
|
},
|
|
91406
91398
|
_a[169 /* SyntaxKind.PropertyDeclaration */] = function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
|
|
91407
91399
|
var _a;
|
|
91408
|
-
return context.factory.updatePropertyDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike),
|
|
91400
|
+
return context.factory.updatePropertyDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), nodeVisitor(node.name, visitor, ts.isPropertyName),
|
|
91409
91401
|
// QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration
|
|
91410
91402
|
nodeVisitor((_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, tokenVisitor, ts.isQuestionOrExclamationToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
|
|
91411
91403
|
},
|
|
91412
91404
|
_a[170 /* SyntaxKind.MethodSignature */] = function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
|
|
91413
|
-
return context.factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.
|
|
91405
|
+
return context.factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91414
91406
|
},
|
|
91415
91407
|
_a[171 /* SyntaxKind.MethodDeclaration */] = function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
|
|
91416
91408
|
return context.factory.updateMethodDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isAsteriskToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));
|
|
@@ -91430,13 +91422,13 @@ var ts;
|
|
|
91430
91422
|
return context.factory.updateClassStaticBlockDeclaration(node, visitFunctionBody(node.body, visitor, context, nodeVisitor));
|
|
91431
91423
|
},
|
|
91432
91424
|
_a[176 /* SyntaxKind.CallSignature */] = function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91433
|
-
return context.factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.
|
|
91425
|
+
return context.factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91434
91426
|
},
|
|
91435
91427
|
_a[177 /* SyntaxKind.ConstructSignature */] = function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91436
|
-
return context.factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.
|
|
91428
|
+
return context.factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91437
91429
|
},
|
|
91438
91430
|
_a[178 /* SyntaxKind.IndexSignature */] = function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91439
|
-
return context.factory.updateIndexSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.
|
|
91431
|
+
return context.factory.updateIndexSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91440
91432
|
},
|
|
91441
91433
|
// Types
|
|
91442
91434
|
_a[179 /* SyntaxKind.TypePredicate */] = function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -91446,10 +91438,10 @@ var ts;
|
|
|
91446
91438
|
return context.factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
|
|
91447
91439
|
},
|
|
91448
91440
|
_a[181 /* SyntaxKind.FunctionType */] = function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91449
|
-
return context.factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.
|
|
91441
|
+
return context.factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91450
91442
|
},
|
|
91451
91443
|
_a[182 /* SyntaxKind.ConstructorType */] = function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91452
|
-
return context.factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.
|
|
91444
|
+
return context.factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91453
91445
|
},
|
|
91454
91446
|
_a[183 /* SyntaxKind.TypeQuery */] = function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91455
91447
|
return context.factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
|
|
@@ -91503,7 +91495,7 @@ var ts;
|
|
|
91503
91495
|
return context.factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isReadonlyKeywordOrPlusOrMinusToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionOrPlusOrMinusToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodesVisitor(node.members, visitor, ts.isTypeElement));
|
|
91504
91496
|
},
|
|
91505
91497
|
_a[198 /* SyntaxKind.LiteralType */] = function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91506
|
-
return context.factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.
|
|
91498
|
+
return context.factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression));
|
|
91507
91499
|
},
|
|
91508
91500
|
_a[200 /* SyntaxKind.TemplateLiteralType */] = function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91509
91501
|
return context.factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan));
|
|
@@ -92993,7 +92985,6 @@ var ts;
|
|
|
92993
92985
|
};
|
|
92994
92986
|
if (value) {
|
|
92995
92987
|
value = ts.visitNode(value, visitor, ts.isExpression);
|
|
92996
|
-
ts.Debug.assert(value);
|
|
92997
92988
|
if (ts.isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText) ||
|
|
92998
92989
|
bindingOrAssignmentElementContainsNonLiteralComputedName(node)) {
|
|
92999
92990
|
// If the right-hand value of the assignment is also an assignment target then
|
|
@@ -93220,7 +93211,7 @@ var ts;
|
|
|
93220
93211
|
&& !(element.transformFlags & (32768 /* TransformFlags.ContainsRestOrSpread */ | 65536 /* TransformFlags.ContainsObjectRestOrSpread */))
|
|
93221
93212
|
&& !(ts.getTargetOfBindingOrAssignmentElement(element).transformFlags & (32768 /* TransformFlags.ContainsRestOrSpread */ | 65536 /* TransformFlags.ContainsObjectRestOrSpread */))
|
|
93222
93213
|
&& !ts.isComputedPropertyName(propertyName)) {
|
|
93223
|
-
bindingElements = ts.append(bindingElements, ts.visitNode(element, flattenContext.visitor
|
|
93214
|
+
bindingElements = ts.append(bindingElements, ts.visitNode(element, flattenContext.visitor));
|
|
93224
93215
|
}
|
|
93225
93216
|
else {
|
|
93226
93217
|
if (bindingElements) {
|
|
@@ -93401,7 +93392,6 @@ var ts;
|
|
|
93401
93392
|
return factory.createArrayBindingPattern(elements);
|
|
93402
93393
|
}
|
|
93403
93394
|
function makeArrayAssignmentPattern(factory, elements) {
|
|
93404
|
-
ts.Debug.assertEachNode(elements, ts.isArrayBindingOrAssignmentElement);
|
|
93405
93395
|
return factory.createArrayLiteralExpression(ts.map(elements, factory.converters.convertToArrayAssignmentElement));
|
|
93406
93396
|
}
|
|
93407
93397
|
function makeObjectBindingPattern(factory, elements) {
|
|
@@ -93409,7 +93399,6 @@ var ts;
|
|
|
93409
93399
|
return factory.createObjectBindingPattern(elements);
|
|
93410
93400
|
}
|
|
93411
93401
|
function makeObjectAssignmentPattern(factory, elements) {
|
|
93412
|
-
ts.Debug.assertEachNode(elements, ts.isObjectBindingOrAssignmentElement);
|
|
93413
93402
|
return factory.createObjectLiteralExpression(ts.map(elements, factory.converters.convertToObjectAssignmentElement));
|
|
93414
93403
|
}
|
|
93415
93404
|
function makeBindingElement(factory, name) {
|
|
@@ -93430,7 +93419,6 @@ var ts;
|
|
|
93430
93419
|
function processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, level) {
|
|
93431
93420
|
// Visit the tag expression
|
|
93432
93421
|
var tag = ts.visitNode(node.tag, visitor, ts.isExpression);
|
|
93433
|
-
ts.Debug.assert(tag);
|
|
93434
93422
|
// Build up the template arguments and the raw and cooked strings for the template.
|
|
93435
93423
|
// We start out with 'undefined' for the first argument and revisit later
|
|
93436
93424
|
// to avoid walking over the template string twice and shifting all our arguments over after the fact.
|
|
@@ -93996,7 +93984,7 @@ var ts;
|
|
|
93996
93984
|
return factory.updateSourceFile(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, /*start*/ 0, alwaysStrict));
|
|
93997
93985
|
}
|
|
93998
93986
|
function visitObjectLiteralExpression(node) {
|
|
93999
|
-
return factory.updateObjectLiteralExpression(node, ts.visitNodes(node.properties, getObjectLiteralElementVisitor(node), ts.
|
|
93987
|
+
return factory.updateObjectLiteralExpression(node, ts.visitNodes(node.properties, getObjectLiteralElementVisitor(node), ts.isObjectLiteralElement));
|
|
94000
93988
|
}
|
|
94001
93989
|
function getClassFacts(node, staticProperties) {
|
|
94002
93990
|
var facts = 0 /* ClassFacts.None */;
|
|
@@ -94182,7 +94170,6 @@ var ts;
|
|
|
94182
94170
|
for (var _i = 0, parameterDecorators_1 = parameterDecorators; _i < parameterDecorators_1.length; _i++) {
|
|
94183
94171
|
var parameterDecorator = parameterDecorators_1[_i];
|
|
94184
94172
|
var expression = ts.visitNode(parameterDecorator.expression, visitor, ts.isExpression);
|
|
94185
|
-
ts.Debug.assert(expression);
|
|
94186
94173
|
var helper = emitHelpers().createParamHelper(expression, parameterOffset);
|
|
94187
94174
|
ts.setTextRange(helper, parameterDecorator.expression);
|
|
94188
94175
|
ts.setEmitFlags(helper, 1536 /* EmitFlags.NoComments */);
|
|
@@ -94325,7 +94312,6 @@ var ts;
|
|
|
94325
94312
|
// - the property has a decorator.
|
|
94326
94313
|
if (ts.isComputedPropertyName(name) && ((!ts.hasStaticModifier(member) && currentClassHasParameterProperties) || ts.hasDecorators(member))) {
|
|
94327
94314
|
var expression = ts.visitNode(name.expression, visitor, ts.isExpression);
|
|
94328
|
-
ts.Debug.assert(expression);
|
|
94329
94315
|
var innerExpression = ts.skipPartiallyEmittedExpressions(expression);
|
|
94330
94316
|
if (!ts.isSimpleInlineableExpression(innerExpression)) {
|
|
94331
94317
|
var generatedName = factory.getGeneratedNameForNode(name);
|
|
@@ -94360,7 +94346,7 @@ var ts;
|
|
|
94360
94346
|
* @param node The ExpressionWithTypeArguments to transform.
|
|
94361
94347
|
*/
|
|
94362
94348
|
function visitExpressionWithTypeArguments(node) {
|
|
94363
|
-
return factory.updateExpressionWithTypeArguments(node, ts.
|
|
94349
|
+
return factory.updateExpressionWithTypeArguments(node, ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression),
|
|
94364
94350
|
/*typeArguments*/ undefined);
|
|
94365
94351
|
}
|
|
94366
94352
|
/**
|
|
@@ -94381,7 +94367,7 @@ var ts;
|
|
|
94381
94367
|
var decorators = transformAllDecoratorsOfDeclaration(node, parent, allDecorators);
|
|
94382
94368
|
// Preserve a `declare x` property with decorators to be handled by the decorators transform
|
|
94383
94369
|
if (isAmbient) {
|
|
94384
|
-
return factory.updatePropertyDeclaration(node, ts.concatenate(decorators, factory.createModifiersFromModifierFlags(2 /* ModifierFlags.Ambient */)), ts.
|
|
94370
|
+
return factory.updatePropertyDeclaration(node, ts.concatenate(decorators, factory.createModifiersFromModifierFlags(2 /* ModifierFlags.Ambient */)), ts.visitNode(node.name, visitor, ts.isPropertyName),
|
|
94385
94371
|
/*questionOrExclamationToken*/ undefined,
|
|
94386
94372
|
/*type*/ undefined,
|
|
94387
94373
|
/*initializer*/ undefined);
|
|
@@ -94542,7 +94528,7 @@ var ts;
|
|
|
94542
94528
|
return undefined;
|
|
94543
94529
|
}
|
|
94544
94530
|
var updated = factory.updateParameterDeclaration(node, ts.elideNodes(factory, node.modifiers), // preserve positions, if available
|
|
94545
|
-
node.dotDotDotToken, ts.
|
|
94531
|
+
node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName),
|
|
94546
94532
|
/*questionToken*/ undefined,
|
|
94547
94533
|
/*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
|
|
94548
94534
|
if (updated !== node) {
|
|
@@ -94594,7 +94580,6 @@ var ts;
|
|
|
94594
94580
|
// Make sure we consider all nested cast expressions, e.g.:
|
|
94595
94581
|
// (<any><number><any>-A).x;
|
|
94596
94582
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
94597
|
-
ts.Debug.assert(expression);
|
|
94598
94583
|
// We have an expression of the form: (<Type>SubExpr). Emitting this as (SubExpr)
|
|
94599
94584
|
// is really not desirable. We would like to emit the subexpression as-is. Omitting
|
|
94600
94585
|
// the parentheses, however, could cause change in the semantics of the generated
|
|
@@ -94618,17 +94603,14 @@ var ts;
|
|
|
94618
94603
|
}
|
|
94619
94604
|
function visitAssertionExpression(node) {
|
|
94620
94605
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
94621
|
-
ts.Debug.assert(expression);
|
|
94622
94606
|
return factory.createPartiallyEmittedExpression(expression, node);
|
|
94623
94607
|
}
|
|
94624
94608
|
function visitNonNullExpression(node) {
|
|
94625
94609
|
var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression);
|
|
94626
|
-
ts.Debug.assert(expression);
|
|
94627
94610
|
return factory.createPartiallyEmittedExpression(expression, node);
|
|
94628
94611
|
}
|
|
94629
94612
|
function visitSatisfiesExpression(node) {
|
|
94630
94613
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
94631
|
-
ts.Debug.assert(expression);
|
|
94632
94614
|
return factory.createPartiallyEmittedExpression(expression, node);
|
|
94633
94615
|
}
|
|
94634
94616
|
function visitCallExpression(node) {
|
|
@@ -94641,7 +94623,7 @@ var ts;
|
|
|
94641
94623
|
}
|
|
94642
94624
|
function visitTaggedTemplateExpression(node) {
|
|
94643
94625
|
return factory.updateTaggedTemplateExpression(node, ts.visitNode(node.tag, visitor, ts.isExpression),
|
|
94644
|
-
/*typeArguments*/ undefined, ts.visitNode(node.template, visitor, ts.
|
|
94626
|
+
/*typeArguments*/ undefined, ts.visitNode(node.template, visitor, ts.isExpression));
|
|
94645
94627
|
}
|
|
94646
94628
|
function visitJsxSelfClosingElement(node) {
|
|
94647
94629
|
return factory.updateJsxSelfClosingElement(node, ts.visitNode(node.tagName, visitor, ts.isJsxTagNameExpression),
|
|
@@ -95671,7 +95653,6 @@ var ts;
|
|
|
95671
95653
|
var info = accessPrivateIdentifier(node.left);
|
|
95672
95654
|
if (info) {
|
|
95673
95655
|
var receiver = ts.visitNode(node.right, visitor, ts.isExpression);
|
|
95674
|
-
ts.Debug.assert(receiver);
|
|
95675
95656
|
return ts.setOriginalNode(context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node);
|
|
95676
95657
|
}
|
|
95677
95658
|
// Private name has not been declared. Subsequent transformers will handle this error
|
|
@@ -95688,7 +95669,6 @@ var ts;
|
|
|
95688
95669
|
}
|
|
95689
95670
|
function visitComputedPropertyName(node) {
|
|
95690
95671
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
95691
|
-
ts.Debug.assert(expression);
|
|
95692
95672
|
if (ts.some(pendingExpressions)) {
|
|
95693
95673
|
if (ts.isParenthesizedExpression(expression)) {
|
|
95694
95674
|
expression = factory.updateParenthesizedExpression(expression, factory.inlineExpressions(__spreadArray(__spreadArray([], pendingExpressions, true), [expression.expression], false)));
|
|
@@ -95768,7 +95748,6 @@ var ts;
|
|
|
95768
95748
|
var temp = factory.createTempVariable(hoistVariableDeclaration);
|
|
95769
95749
|
ts.setSourceMapRange(temp, name.expression);
|
|
95770
95750
|
var expression = ts.visitNode(name.expression, visitor, ts.isExpression);
|
|
95771
|
-
ts.Debug.assert(expression);
|
|
95772
95751
|
var assignment = factory.createAssignment(temp, expression);
|
|
95773
95752
|
ts.setSourceMapRange(assignment, name.expression);
|
|
95774
95753
|
getterName = factory.updateComputedPropertyName(name, factory.inlineExpressions([assignment, temp]));
|
|
@@ -95919,7 +95898,6 @@ var ts;
|
|
|
95919
95898
|
var info = void 0;
|
|
95920
95899
|
if (info = accessPrivateIdentifier(operand.name)) {
|
|
95921
95900
|
var receiver = ts.visitNode(operand.expression, visitor, ts.isExpression);
|
|
95922
|
-
ts.Debug.assert(receiver);
|
|
95923
95901
|
var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;
|
|
95924
95902
|
var expression = createPrivateIdentifierAccess(info, readExpression);
|
|
95925
95903
|
var temp = ts.isPrefixUnaryExpression(node) || valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
|
|
@@ -96123,17 +96101,14 @@ var ts;
|
|
|
96123
96101
|
var superPropertyGet = factory.createReflectGetCall(superClassReference, getterName, classConstructor);
|
|
96124
96102
|
ts.setOriginalNode(superPropertyGet, node.left);
|
|
96125
96103
|
ts.setTextRange(superPropertyGet, node.left);
|
|
96126
|
-
ts.Debug.assert(expression);
|
|
96127
96104
|
expression = factory.createBinaryExpression(superPropertyGet, ts.getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), expression);
|
|
96128
96105
|
ts.setTextRange(expression, node);
|
|
96129
96106
|
}
|
|
96130
96107
|
var temp = valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
|
|
96131
96108
|
if (temp) {
|
|
96132
|
-
ts.Debug.assert(expression);
|
|
96133
96109
|
expression = factory.createAssignment(temp, expression);
|
|
96134
96110
|
ts.setTextRange(temp, node);
|
|
96135
96111
|
}
|
|
96136
|
-
ts.Debug.assert(expression);
|
|
96137
96112
|
expression = factory.createReflectSetCall(superClassReference, setterName, expression, classConstructor);
|
|
96138
96113
|
ts.setOriginalNode(expression, node);
|
|
96139
96114
|
ts.setTextRange(expression, node);
|
|
@@ -96893,7 +96868,6 @@ var ts;
|
|
|
96893
96868
|
function getPropertyNameExpressionIfNeeded(name, shouldHoist) {
|
|
96894
96869
|
if (ts.isComputedPropertyName(name)) {
|
|
96895
96870
|
var expression = ts.visitNode(name.expression, visitor, ts.isExpression);
|
|
96896
|
-
ts.Debug.assert(expression);
|
|
96897
96871
|
var innerExpression = ts.skipPartiallyEmittedExpressions(expression);
|
|
96898
96872
|
var inlinable = ts.isSimpleInlineableExpression(innerExpression);
|
|
96899
96873
|
var alreadyTransformed = ts.isAssignmentExpression(innerExpression) && ts.isGeneratedIdentifier(innerExpression.left);
|
|
@@ -97217,8 +97191,7 @@ var ts;
|
|
|
97217
97191
|
//
|
|
97218
97192
|
// Transformation:
|
|
97219
97193
|
// [ { set value(x) { this.#myProp = x; } }.value ] = [ "hello" ];
|
|
97220
|
-
return factory.updateArrayLiteralExpression(node, ts.visitNodes(node.elements, visitArrayAssignmentTarget, ts.isExpression)
|
|
97221
|
-
);
|
|
97194
|
+
return factory.updateArrayLiteralExpression(node, ts.visitNodes(node.elements, visitArrayAssignmentTarget, ts.isExpression));
|
|
97222
97195
|
}
|
|
97223
97196
|
else {
|
|
97224
97197
|
// Transforms private names in destructuring assignment object bindings.
|
|
@@ -97938,7 +97911,7 @@ var ts;
|
|
|
97938
97911
|
/*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), ts.visitNodes(node.members, visitor, ts.isClassElement));
|
|
97939
97912
|
}
|
|
97940
97913
|
function visitConstructorDeclaration(node) {
|
|
97941
|
-
return factory.updateConstructorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNodes(node.parameters, visitor, ts.
|
|
97914
|
+
return factory.updateConstructorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration), ts.visitNode(node.body, visitor, ts.isBlock));
|
|
97942
97915
|
}
|
|
97943
97916
|
function finishClassElement(updated, original) {
|
|
97944
97917
|
if (updated !== original) {
|
|
@@ -97952,26 +97925,26 @@ var ts;
|
|
|
97952
97925
|
function visitMethodDeclaration(node) {
|
|
97953
97926
|
return finishClassElement(factory.updateMethodDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName),
|
|
97954
97927
|
/*questionToken*/ undefined,
|
|
97955
|
-
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.
|
|
97928
|
+
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration),
|
|
97956
97929
|
/*type*/ undefined, ts.visitNode(node.body, visitor, ts.isBlock)), node);
|
|
97957
97930
|
}
|
|
97958
97931
|
function visitGetAccessorDeclaration(node) {
|
|
97959
|
-
return finishClassElement(factory.updateGetAccessorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNodes(node.parameters, visitor, ts.
|
|
97932
|
+
return finishClassElement(factory.updateGetAccessorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration),
|
|
97960
97933
|
/*type*/ undefined, ts.visitNode(node.body, visitor, ts.isBlock)), node);
|
|
97961
97934
|
}
|
|
97962
97935
|
function visitSetAccessorDeclaration(node) {
|
|
97963
|
-
return finishClassElement(factory.updateSetAccessorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNodes(node.parameters, visitor, ts.
|
|
97936
|
+
return finishClassElement(factory.updateSetAccessorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration), ts.visitNode(node.body, visitor, ts.isBlock)), node);
|
|
97964
97937
|
}
|
|
97965
97938
|
function visitPropertyDeclaration(node) {
|
|
97966
97939
|
if (node.flags & 16777216 /* NodeFlags.Ambient */ || ts.hasSyntacticModifier(node, 2 /* ModifierFlags.Ambient */)) {
|
|
97967
97940
|
return undefined;
|
|
97968
97941
|
}
|
|
97969
|
-
return finishClassElement(factory.updatePropertyDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.
|
|
97942
|
+
return finishClassElement(factory.updatePropertyDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName),
|
|
97970
97943
|
/*questionOrExclamationToken*/ undefined,
|
|
97971
97944
|
/*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)), node);
|
|
97972
97945
|
}
|
|
97973
97946
|
function visitParameterDeclaration(node) {
|
|
97974
|
-
var updated = factory.updateParameterDeclaration(node, ts.elideNodes(factory, node.modifiers), node.dotDotDotToken, ts.
|
|
97947
|
+
var updated = factory.updateParameterDeclaration(node, ts.elideNodes(factory, node.modifiers), node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName),
|
|
97975
97948
|
/*questionToken*/ undefined,
|
|
97976
97949
|
/*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
|
|
97977
97950
|
if (updated !== node) {
|
|
@@ -98145,7 +98118,7 @@ var ts;
|
|
|
98145
98118
|
* @param decorator The decorator node.
|
|
98146
98119
|
*/
|
|
98147
98120
|
function transformDecorator(decorator) {
|
|
98148
|
-
return ts.
|
|
98121
|
+
return ts.visitNode(decorator.expression, visitor, ts.isExpression);
|
|
98149
98122
|
}
|
|
98150
98123
|
/**
|
|
98151
98124
|
* Transforms the decorators of a parameter.
|
|
@@ -98456,7 +98429,7 @@ var ts;
|
|
|
98456
98429
|
: ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, asyncBodyVisitor, context));
|
|
98457
98430
|
}
|
|
98458
98431
|
function visitForOfStatementInAsyncBody(node) {
|
|
98459
|
-
return factory.updateForOfStatement(node, ts.visitNode(node.awaitModifier, visitor, ts.
|
|
98432
|
+
return factory.updateForOfStatement(node, ts.visitNode(node.awaitModifier, visitor, ts.isToken), isVariableDeclarationListWithCollidingName(node.initializer)
|
|
98460
98433
|
? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true)
|
|
98461
98434
|
: ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, asyncBodyVisitor, context));
|
|
98462
98435
|
}
|
|
@@ -98521,7 +98494,7 @@ var ts;
|
|
|
98521
98494
|
* @param node The node to visit.
|
|
98522
98495
|
*/
|
|
98523
98496
|
function visitFunctionExpression(node) {
|
|
98524
|
-
return factory.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.
|
|
98497
|
+
return factory.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.asteriskToken, node.name,
|
|
98525
98498
|
/*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context),
|
|
98526
98499
|
/*type*/ undefined, ts.getFunctionFlags(node) & 2 /* FunctionFlags.Async */
|
|
98527
98500
|
? transformAsyncFunctionBody(node)
|
|
@@ -98536,7 +98509,7 @@ var ts;
|
|
|
98536
98509
|
* @param node The node to visit.
|
|
98537
98510
|
*/
|
|
98538
98511
|
function visitArrowFunction(node) {
|
|
98539
|
-
return factory.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.
|
|
98512
|
+
return factory.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike),
|
|
98540
98513
|
/*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context),
|
|
98541
98514
|
/*type*/ undefined, node.equalsGreaterThanToken, ts.getFunctionFlags(node) & 2 /* FunctionFlags.Async */
|
|
98542
98515
|
? transformAsyncFunctionBody(node)
|
|
@@ -98592,7 +98565,7 @@ var ts;
|
|
|
98592
98565
|
}
|
|
98593
98566
|
function transformInitializedVariable(node) {
|
|
98594
98567
|
var converted = ts.setSourceMapRange(factory.createAssignment(factory.converters.convertToAssignmentElementTarget(node.name), node.initializer), node);
|
|
98595
|
-
return ts.
|
|
98568
|
+
return ts.visitNode(converted, visitor, ts.isExpression);
|
|
98596
98569
|
}
|
|
98597
98570
|
function collidesWithParameterName(_a) {
|
|
98598
98571
|
var name = _a.name;
|
|
@@ -99456,7 +99429,7 @@ var ts;
|
|
|
99456
99429
|
? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifierLike)
|
|
99457
99430
|
: node.modifiers, enclosingFunctionFlags & 2 /* FunctionFlags.Async */
|
|
99458
99431
|
? undefined
|
|
99459
|
-
: node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(/*questionToken*/ undefined, visitor, ts.
|
|
99432
|
+
: node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(/*questionToken*/ undefined, visitor, ts.isToken),
|
|
99460
99433
|
/*typeParameters*/ undefined, ts.visitParameterList(node.parameters, parameterVisitor, context),
|
|
99461
99434
|
/*type*/ undefined, enclosingFunctionFlags & 2 /* FunctionFlags.Async */ && enclosingFunctionFlags & 1 /* FunctionFlags.Generator */
|
|
99462
99435
|
? transformAsyncGeneratorFunctionBody(node)
|
|
@@ -100345,7 +100318,7 @@ var ts;
|
|
|
100345
100318
|
return ts.singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions);
|
|
100346
100319
|
}
|
|
100347
100320
|
function transformJsxSpreadAttributeToExpression(node) {
|
|
100348
|
-
return ts.
|
|
100321
|
+
return ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
100349
100322
|
}
|
|
100350
100323
|
function transformJsxAttributeToObjectLiteralElement(node) {
|
|
100351
100324
|
var name = getAttributeName(node);
|
|
@@ -102013,7 +101986,6 @@ var ts;
|
|
|
102013
101986
|
var sourceMapRange = ts.getSourceMapRange(member);
|
|
102014
101987
|
var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined, container);
|
|
102015
101988
|
var propertyName = ts.visitNode(member.name, visitor, ts.isPropertyName);
|
|
102016
|
-
ts.Debug.assert(propertyName);
|
|
102017
101989
|
var e;
|
|
102018
101990
|
if (!ts.isPrivateIdentifier(propertyName) && ts.getUseDefineForClassFields(context.getCompilerOptions())) {
|
|
102019
101991
|
var name = ts.isComputedPropertyName(propertyName) ? propertyName.expression
|
|
@@ -102066,7 +102038,6 @@ var ts;
|
|
|
102066
102038
|
ts.setEmitFlags(target, 1536 /* EmitFlags.NoComments */ | 32 /* EmitFlags.NoTrailingSourceMap */);
|
|
102067
102039
|
ts.setSourceMapRange(target, firstAccessor.name);
|
|
102068
102040
|
var visitedAccessorName = ts.visitNode(firstAccessor.name, visitor, ts.isPropertyName);
|
|
102069
|
-
ts.Debug.assert(visitedAccessorName);
|
|
102070
102041
|
if (ts.isPrivateIdentifier(visitedAccessorName)) {
|
|
102071
102042
|
return ts.Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015.");
|
|
102072
102043
|
}
|
|
@@ -102341,7 +102312,6 @@ var ts;
|
|
|
102341
102312
|
var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression);
|
|
102342
102313
|
if (result || visited !== element) {
|
|
102343
102314
|
result || (result = node.elements.slice(0, i));
|
|
102344
|
-
ts.Debug.assert(visited);
|
|
102345
102315
|
result.push(visited);
|
|
102346
102316
|
}
|
|
102347
102317
|
}
|
|
@@ -102401,7 +102371,6 @@ var ts;
|
|
|
102401
102371
|
var declarations = ts.flatMap(node.declarations, node.flags & 1 /* NodeFlags.Let */
|
|
102402
102372
|
? visitVariableDeclarationInLetDeclarationList
|
|
102403
102373
|
: visitVariableDeclaration);
|
|
102404
|
-
ts.Debug.assertEachNode(declarations, ts.isVariableDeclaration); // TODO(jakebailey): side effect of VisitResult.
|
|
102405
102374
|
var declarationList = factory.createVariableDeclarationList(declarations);
|
|
102406
102375
|
ts.setOriginalNode(declarationList, node);
|
|
102407
102376
|
ts.setTextRange(declarationList, node);
|
|
@@ -102621,7 +102590,6 @@ var ts;
|
|
|
102621
102590
|
}
|
|
102622
102591
|
else {
|
|
102623
102592
|
var statement = ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock);
|
|
102624
|
-
ts.Debug.assert(statement);
|
|
102625
102593
|
if (ts.isBlock(statement)) {
|
|
102626
102594
|
return factory.updateBlock(statement, ts.setTextRange(factory.createNodeArray(ts.concatenate(statements, statement.statements)), statement.statements));
|
|
102627
102595
|
}
|
|
@@ -102657,7 +102625,6 @@ var ts;
|
|
|
102657
102625
|
// Note also that because an extra statement is needed to assign to the LHS,
|
|
102658
102626
|
// for-of bodies are always emitted as blocks.
|
|
102659
102627
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
102660
|
-
ts.Debug.assert(expression);
|
|
102661
102628
|
// In the case where the user wrote an identifier as the RHS, like this:
|
|
102662
102629
|
//
|
|
102663
102630
|
// for (let v of arr) { }
|
|
@@ -102683,7 +102650,6 @@ var ts;
|
|
|
102683
102650
|
}
|
|
102684
102651
|
function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) {
|
|
102685
102652
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
102686
|
-
ts.Debug.assert(expression);
|
|
102687
102653
|
var iterator = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable(/*recordTempVariable*/ undefined);
|
|
102688
102654
|
var result = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(iterator) : factory.createTempVariable(/*recordTempVariable*/ undefined);
|
|
102689
102655
|
var errorRecord = factory.createUniqueName("e");
|
|
@@ -103112,7 +103078,6 @@ var ts;
|
|
|
103112
103078
|
statements.push(factory.createIfStatement(factory.createPrefixUnaryExpression(53 /* SyntaxKind.ExclamationToken */, ts.visitNode(node.condition, visitor, ts.isExpression)), ts.visitNode(factory.createBreakStatement(), visitor, ts.isStatement)));
|
|
103113
103079
|
}
|
|
103114
103080
|
}
|
|
103115
|
-
ts.Debug.assert(statement);
|
|
103116
103081
|
if (ts.isBlock(statement)) {
|
|
103117
103082
|
ts.addRange(statements, statement.statements);
|
|
103118
103083
|
}
|
|
@@ -103753,9 +103718,7 @@ var ts;
|
|
|
103753
103718
|
return ts.map(chunk, visitExpressionOfSpread);
|
|
103754
103719
|
}
|
|
103755
103720
|
function visitExpressionOfSpread(node) {
|
|
103756
|
-
ts.Debug.assertNode(node, ts.isSpreadElement);
|
|
103757
103721
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
103758
|
-
ts.Debug.assert(expression);
|
|
103759
103722
|
// We don't need to pack already packed array literals, or existing calls to the `__read` helper.
|
|
103760
103723
|
var isCallToReadHelper = ts.isCallToHelper(expression, "___read");
|
|
103761
103724
|
var kind = isCallToReadHelper || ts.isPackedArrayLiteral(expression) ? 2 /* SpreadSegmentKind.PackedSpread */ : 1 /* SpreadSegmentKind.UnpackedSpread */;
|
|
@@ -103823,7 +103786,7 @@ var ts;
|
|
|
103823
103786
|
var expression = factory.createStringLiteral(node.head.text);
|
|
103824
103787
|
for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {
|
|
103825
103788
|
var span = _a[_i];
|
|
103826
|
-
var args = [ts.
|
|
103789
|
+
var args = [ts.visitNode(span.expression, visitor, ts.isExpression)];
|
|
103827
103790
|
if (span.literal.text.length > 0) {
|
|
103828
103791
|
args.push(factory.createStringLiteral(span.literal.text));
|
|
103829
103792
|
}
|
|
@@ -104724,7 +104687,7 @@ var ts;
|
|
|
104724
104687
|
// .yield resumeLabel
|
|
104725
104688
|
// .mark resumeLabel
|
|
104726
104689
|
// _a.b = %sent%;
|
|
104727
|
-
target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.
|
|
104690
|
+
target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);
|
|
104728
104691
|
break;
|
|
104729
104692
|
case 209 /* SyntaxKind.ElementAccessExpression */:
|
|
104730
104693
|
// [source]
|
|
@@ -104737,7 +104700,7 @@ var ts;
|
|
|
104737
104700
|
// .yield resumeLabel
|
|
104738
104701
|
// .mark resumeLabel
|
|
104739
104702
|
// _a[_b] = %sent%;
|
|
104740
|
-
target = factory.updateElementAccessExpression(left, cacheExpression(ts.
|
|
104703
|
+
target = factory.updateElementAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression)));
|
|
104741
104704
|
break;
|
|
104742
104705
|
default:
|
|
104743
104706
|
target = ts.visitNode(left, visitor, ts.isExpression);
|
|
@@ -105055,7 +105018,7 @@ var ts;
|
|
|
105055
105018
|
// .yield resumeLabel
|
|
105056
105019
|
// .mark resumeLabel
|
|
105057
105020
|
// a = _a[%sent%]
|
|
105058
|
-
return factory.updateElementAccessExpression(node, cacheExpression(ts.
|
|
105021
|
+
return factory.updateElementAccessExpression(node, cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)), ts.visitNode(node.argumentExpression, visitor, ts.isExpression));
|
|
105059
105022
|
}
|
|
105060
105023
|
return ts.visitEachChild(node, visitor, context);
|
|
105061
105024
|
}
|
|
@@ -105072,7 +105035,7 @@ var ts;
|
|
|
105072
105035
|
// .mark resumeLabel
|
|
105073
105036
|
// _b.apply(_a, _c.concat([%sent%, 2]));
|
|
105074
105037
|
var _a = factory.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion, /*cacheIdentifiers*/ true), target = _a.target, thisArg = _a.thisArg;
|
|
105075
|
-
return ts.setOriginalNode(ts.setTextRange(factory.createFunctionApplyCall(cacheExpression(ts.
|
|
105038
|
+
return ts.setOriginalNode(ts.setTextRange(factory.createFunctionApplyCall(cacheExpression(ts.visitNode(target, visitor, ts.isLeftHandSideExpression)), thisArg, visitElements(node.arguments)), node), node);
|
|
105076
105039
|
}
|
|
105077
105040
|
return ts.visitEachChild(node, visitor, context);
|
|
105078
105041
|
}
|
|
@@ -107057,7 +107020,7 @@ var ts;
|
|
|
107057
107020
|
*/
|
|
107058
107021
|
function addExportEqualsIfNeeded(statements, emitAsReturn) {
|
|
107059
107022
|
if (currentModuleInfo.exportEquals) {
|
|
107060
|
-
var expressionResult = ts.visitNode(currentModuleInfo.exportEquals.expression, visitor
|
|
107023
|
+
var expressionResult = ts.visitNode(currentModuleInfo.exportEquals.expression, visitor);
|
|
107061
107024
|
if (expressionResult) {
|
|
107062
107025
|
if (emitAsReturn) {
|
|
107063
107026
|
var statement = factory.createReturnStatement(expressionResult);
|
|
@@ -107257,7 +107220,7 @@ var ts;
|
|
|
107257
107220
|
}
|
|
107258
107221
|
function visitImportCallExpression(node) {
|
|
107259
107222
|
var externalModuleName = ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);
|
|
107260
|
-
var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor
|
|
107223
|
+
var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor);
|
|
107261
107224
|
// Only use the external module name if it differs from the first argument. This allows us to preserve the quote style of the argument on output.
|
|
107262
107225
|
var argument = externalModuleName && (!firstArgument || !ts.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
|
|
107263
107226
|
var containsLexicalThis = !!(node.transformFlags & 16384 /* TransformFlags.ContainsLexicalThis */);
|
|
@@ -107605,7 +107568,7 @@ var ts;
|
|
|
107605
107568
|
var statements;
|
|
107606
107569
|
if (ts.hasSyntacticModifier(node, 1 /* ModifierFlags.Export */)) {
|
|
107607
107570
|
statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createFunctionDeclaration(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
|
|
107608
|
-
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor
|
|
107571
|
+
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor),
|
|
107609
107572
|
/*type*/ undefined, ts.visitEachChild(node.body, visitor, context)),
|
|
107610
107573
|
/*location*/ node),
|
|
107611
107574
|
/*original*/ node));
|
|
@@ -107632,7 +107595,7 @@ var ts;
|
|
|
107632
107595
|
var statements;
|
|
107633
107596
|
if (ts.hasSyntacticModifier(node, 1 /* ModifierFlags.Export */)) {
|
|
107634
107597
|
statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createClassDeclaration(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifierLike), factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
|
|
107635
|
-
/*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor
|
|
107598
|
+
/*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor), ts.visitNodes(node.members, visitor)), node), node));
|
|
107636
107599
|
}
|
|
107637
107600
|
else {
|
|
107638
107601
|
statements = ts.append(statements, ts.visitEachChild(node, visitor, context));
|
|
@@ -107672,7 +107635,7 @@ var ts;
|
|
|
107672
107635
|
if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) {
|
|
107673
107636
|
var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name),
|
|
107674
107637
|
/*location*/ variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name)));
|
|
107675
|
-
var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, visitor
|
|
107638
|
+
var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, visitor));
|
|
107676
107639
|
variables = ts.append(variables, updatedVariable);
|
|
107677
107640
|
expressions = ts.append(expressions, expression);
|
|
107678
107641
|
removeCommentsOnExpressions = true;
|
|
@@ -108700,7 +108663,7 @@ var ts;
|
|
|
108700
108663
|
function visitFunctionDeclaration(node) {
|
|
108701
108664
|
if (ts.hasSyntacticModifier(node, 1 /* ModifierFlags.Export */)) {
|
|
108702
108665
|
hoistedStatements = ts.append(hoistedStatements, factory.updateFunctionDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifierLike), node.asteriskToken, factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
|
|
108703
|
-
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.
|
|
108666
|
+
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration),
|
|
108704
108667
|
/*type*/ undefined, ts.visitNode(node.body, visitor, ts.isBlock)));
|
|
108705
108668
|
}
|
|
108706
108669
|
else {
|
|
@@ -109216,7 +109179,7 @@ var ts;
|
|
|
109216
109179
|
return expressions ? factory.inlineExpressions(expressions) : factory.createOmittedExpression();
|
|
109217
109180
|
}
|
|
109218
109181
|
else {
|
|
109219
|
-
return ts.visitNode(node, discardedValueVisitor, ts.
|
|
109182
|
+
return ts.visitNode(node, discardedValueVisitor, ts.isExpression);
|
|
109220
109183
|
}
|
|
109221
109184
|
}
|
|
109222
109185
|
/**
|
|
@@ -109388,7 +109351,7 @@ var ts;
|
|
|
109388
109351
|
// };
|
|
109389
109352
|
// });
|
|
109390
109353
|
var externalModuleName = ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);
|
|
109391
|
-
var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor
|
|
109354
|
+
var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor);
|
|
109392
109355
|
// Only use the external module name if it differs from the first argument. This allows us to preserve the quote style of the argument on output.
|
|
109393
109356
|
var argument = externalModuleName && (!firstArgument || !ts.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
|
|
109394
109357
|
return factory.createCallExpression(factory.createPropertyAccessExpression(contextObject, factory.createIdentifier("import")),
|
|
@@ -110608,7 +110571,7 @@ var ts;
|
|
|
110608
110571
|
var _a;
|
|
110609
110572
|
var primaryDeclaration = (_a = parentSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return ts.getSourceFileOfNode(d) === containingFile; });
|
|
110610
110573
|
var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; });
|
|
110611
|
-
if (augmentingDeclarations) {
|
|
110574
|
+
if (primaryDeclaration && augmentingDeclarations) {
|
|
110612
110575
|
for (var _i = 0, augmentingDeclarations_1 = augmentingDeclarations; _i < augmentingDeclarations_1.length; _i++) {
|
|
110613
110576
|
var augmentations = augmentingDeclarations_1[_i];
|
|
110614
110577
|
context.addDiagnostic(ts.addRelatedInfo(ts.createDiagnosticForNode(augmentations, ts.Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized), ts.createDiagnosticForNode(primaryDeclaration, ts.Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)));
|
|
@@ -110663,12 +110626,12 @@ var ts;
|
|
|
110663
110626
|
if (ts.isExternalOrCommonJsModule(sourceFile) || ts.isJsonSourceFile(sourceFile)) {
|
|
110664
110627
|
resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)
|
|
110665
110628
|
needsDeclare = false;
|
|
110666
|
-
var statements = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements
|
|
110629
|
+
var statements = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
|
|
110667
110630
|
var newFile = factory.updateSourceFile(sourceFile, [factory.createModuleDeclaration([factory.createModifier(136 /* SyntaxKind.DeclareKeyword */)], factory.createStringLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), factory.createModuleBlock(ts.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);
|
|
110668
110631
|
return newFile;
|
|
110669
110632
|
}
|
|
110670
110633
|
needsDeclare = true;
|
|
110671
|
-
var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements
|
|
110634
|
+
var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
|
|
110672
110635
|
return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);
|
|
110673
110636
|
}), ts.mapDefined(node.prepends, function (prepend) {
|
|
110674
110637
|
if (prepend.kind === 311 /* SyntaxKind.InputFiles */) {
|
|
@@ -110715,7 +110678,7 @@ var ts;
|
|
|
110715
110678
|
emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
|
|
110716
110679
|
}
|
|
110717
110680
|
else {
|
|
110718
|
-
var statements = ts.visitNodes(node.statements, visitDeclarationStatements
|
|
110681
|
+
var statements = ts.visitNodes(node.statements, visitDeclarationStatements);
|
|
110719
110682
|
combinedStatements = ts.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements);
|
|
110720
110683
|
refs.forEach(referenceVisitor);
|
|
110721
110684
|
emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
|
|
@@ -110813,10 +110776,10 @@ var ts;
|
|
|
110813
110776
|
}
|
|
110814
110777
|
else {
|
|
110815
110778
|
if (name.kind === 204 /* SyntaxKind.ArrayBindingPattern */) {
|
|
110816
|
-
return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement
|
|
110779
|
+
return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));
|
|
110817
110780
|
}
|
|
110818
110781
|
else {
|
|
110819
|
-
return factory.updateObjectBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement
|
|
110782
|
+
return factory.updateObjectBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));
|
|
110820
110783
|
}
|
|
110821
110784
|
}
|
|
110822
110785
|
function visitBindingElement(elem) {
|
|
@@ -110866,10 +110829,10 @@ var ts;
|
|
|
110866
110829
|
(resolver.isRequiredInitializedParameter(node) ||
|
|
110867
110830
|
resolver.isOptionalUninitializedParameterProperty(node));
|
|
110868
110831
|
if (type && !shouldUseResolverType) {
|
|
110869
|
-
return ts.visitNode(type, visitDeclarationSubtree
|
|
110832
|
+
return ts.visitNode(type, visitDeclarationSubtree);
|
|
110870
110833
|
}
|
|
110871
110834
|
if (!ts.getParseTreeNode(node)) {
|
|
110872
|
-
return type ? ts.visitNode(type, visitDeclarationSubtree
|
|
110835
|
+
return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */);
|
|
110873
110836
|
}
|
|
110874
110837
|
if (node.kind === 175 /* SyntaxKind.SetAccessor */) {
|
|
110875
110838
|
// Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now
|
|
@@ -110982,7 +110945,7 @@ var ts;
|
|
|
110982
110945
|
return factory.createNodeArray(newParams || ts.emptyArray);
|
|
110983
110946
|
}
|
|
110984
110947
|
function ensureTypeParams(node, params) {
|
|
110985
|
-
return ts.hasEffectiveModifier(node, 8 /* ModifierFlags.Private */) ? undefined : ts.visitNodes(params, visitDeclarationSubtree
|
|
110948
|
+
return ts.hasEffectiveModifier(node, 8 /* ModifierFlags.Private */) ? undefined : ts.visitNodes(params, visitDeclarationSubtree);
|
|
110986
110949
|
}
|
|
110987
110950
|
function isEnclosingDeclaration(node) {
|
|
110988
110951
|
return ts.isSourceFile(node)
|
|
@@ -111114,7 +111077,6 @@ var ts;
|
|
|
111114
111077
|
var key = ts.getOriginalNodeId(statement);
|
|
111115
111078
|
if (lateStatementReplacementMap.has(key)) {
|
|
111116
111079
|
var result = lateStatementReplacementMap.get(key);
|
|
111117
|
-
ts.Debug.type(result);
|
|
111118
111080
|
lateStatementReplacementMap.delete(key);
|
|
111119
111081
|
if (result) {
|
|
111120
111082
|
if (ts.isArray(result) ? ts.some(result, ts.needsScopeMarker) : ts.needsScopeMarker(result)) {
|
|
@@ -111262,17 +111224,13 @@ var ts;
|
|
|
111262
111224
|
case 191 /* SyntaxKind.ConditionalType */: {
|
|
111263
111225
|
// We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration
|
|
111264
111226
|
// just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type.
|
|
111265
|
-
var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree
|
|
111266
|
-
var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree
|
|
111227
|
+
var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree);
|
|
111228
|
+
var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree);
|
|
111267
111229
|
var oldEnclosingDecl = enclosingDeclaration;
|
|
111268
111230
|
enclosingDeclaration = input.trueType;
|
|
111269
|
-
var trueType = ts.visitNode(input.trueType, visitDeclarationSubtree
|
|
111231
|
+
var trueType = ts.visitNode(input.trueType, visitDeclarationSubtree);
|
|
111270
111232
|
enclosingDeclaration = oldEnclosingDecl;
|
|
111271
|
-
var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree
|
|
111272
|
-
ts.Debug.assert(checkType);
|
|
111273
|
-
ts.Debug.assert(extendsType);
|
|
111274
|
-
ts.Debug.assert(trueType);
|
|
111275
|
-
ts.Debug.assert(falseType);
|
|
111233
|
+
var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree);
|
|
111276
111234
|
return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
|
|
111277
111235
|
}
|
|
111278
111236
|
case 181 /* SyntaxKind.FunctionType */: {
|
|
@@ -111410,7 +111368,7 @@ var ts;
|
|
|
111410
111368
|
return clean;
|
|
111411
111369
|
}
|
|
111412
111370
|
case 261 /* SyntaxKind.InterfaceDeclaration */: {
|
|
111413
|
-
return cleanup(factory.updateInterfaceDeclaration(input, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree
|
|
111371
|
+
return cleanup(factory.updateInterfaceDeclaration(input, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree)));
|
|
111414
111372
|
}
|
|
111415
111373
|
case 259 /* SyntaxKind.FunctionDeclaration */: {
|
|
111416
111374
|
// Generators lose their generator-ness, excepting their return type
|
|
@@ -111482,7 +111440,7 @@ var ts;
|
|
|
111482
111440
|
var oldHasScopeFix = resultHasScopeMarker;
|
|
111483
111441
|
resultHasScopeMarker = false;
|
|
111484
111442
|
needsScopeFixMarker = false;
|
|
111485
|
-
var statements = ts.visitNodes(inner.statements, visitDeclarationStatements
|
|
111443
|
+
var statements = ts.visitNodes(inner.statements, visitDeclarationStatements);
|
|
111486
111444
|
var lateStatements = transformAndReplaceLatePaintedStatements(statements);
|
|
111487
111445
|
if (input.flags & 16777216 /* NodeFlags.Ambient */) {
|
|
111488
111446
|
needsScopeFixMarker = false; // If it was `declare`'d everything is implicitly exported already, ignore late printed "privates"
|
|
@@ -111567,7 +111525,7 @@ var ts;
|
|
|
111567
111525
|
/*type*/ undefined,
|
|
111568
111526
|
/*initializer*/ undefined)
|
|
111569
111527
|
] : undefined;
|
|
111570
|
-
var memberNodes = ts.concatenate(ts.concatenate(privateIdentifier, parameterProperties), ts.visitNodes(input.members, visitDeclarationSubtree
|
|
111528
|
+
var memberNodes = ts.concatenate(ts.concatenate(privateIdentifier, parameterProperties), ts.visitNodes(input.members, visitDeclarationSubtree));
|
|
111571
111529
|
var members = factory.createNodeArray(memberNodes);
|
|
111572
111530
|
var extendsClause_1 = ts.getEffectiveBaseTypeNode(input);
|
|
111573
111531
|
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* SyntaxKind.NullKeyword */) {
|
|
@@ -111585,11 +111543,11 @@ var ts;
|
|
|
111585
111543
|
if (clause.token === 94 /* SyntaxKind.ExtendsKeyword */) {
|
|
111586
111544
|
var oldDiag_2 = getSymbolAccessibilityDiagnostic;
|
|
111587
111545
|
getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]);
|
|
111588
|
-
var newClause = factory.updateHeritageClause(clause, ts.map(clause.types, function (t) { return factory.updateExpressionWithTypeArguments(t, newId_1, ts.visitNodes(t.typeArguments, visitDeclarationSubtree
|
|
111546
|
+
var newClause = factory.updateHeritageClause(clause, ts.map(clause.types, function (t) { return factory.updateExpressionWithTypeArguments(t, newId_1, ts.visitNodes(t.typeArguments, visitDeclarationSubtree)); }));
|
|
111589
111547
|
getSymbolAccessibilityDiagnostic = oldDiag_2;
|
|
111590
111548
|
return newClause;
|
|
111591
111549
|
}
|
|
111592
|
-
return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 104 /* SyntaxKind.NullKeyword */; })), visitDeclarationSubtree
|
|
111550
|
+
return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 104 /* SyntaxKind.NullKeyword */; })), visitDeclarationSubtree));
|
|
111593
111551
|
}));
|
|
111594
111552
|
return [statement, cleanup(factory.updateClassDeclaration(input, modifiers, input.name, typeParameters, heritageClauses, members))]; // TODO: GH#18217
|
|
111595
111553
|
}
|
|
@@ -111634,7 +111592,7 @@ var ts;
|
|
|
111634
111592
|
function transformVariableStatement(input) {
|
|
111635
111593
|
if (!ts.forEach(input.declarationList.declarations, getBindingNameVisible))
|
|
111636
111594
|
return;
|
|
111637
|
-
var nodes = ts.visitNodes(input.declarationList.declarations, visitDeclarationSubtree
|
|
111595
|
+
var nodes = ts.visitNodes(input.declarationList.declarations, visitDeclarationSubtree);
|
|
111638
111596
|
if (!ts.length(nodes))
|
|
111639
111597
|
return;
|
|
111640
111598
|
return factory.updateVariableStatement(input, factory.createNodeArray(ensureModifiers(input)), factory.updateVariableDeclarationList(input.declarationList, nodes));
|
|
@@ -111717,7 +111675,7 @@ var ts;
|
|
|
111717
111675
|
function transformHeritageClauses(nodes) {
|
|
111718
111676
|
return factory.createNodeArray(ts.filter(ts.map(nodes, function (clause) { return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) {
|
|
111719
111677
|
return ts.isEntityNameExpression(t.expression) || (clause.token === 94 /* SyntaxKind.ExtendsKeyword */ && t.expression.kind === 104 /* SyntaxKind.NullKeyword */);
|
|
111720
|
-
})), visitDeclarationSubtree
|
|
111678
|
+
})), visitDeclarationSubtree)); }), function (clause) { return clause.types && !!clause.types.length; }));
|
|
111721
111679
|
}
|
|
111722
111680
|
}
|
|
111723
111681
|
ts.transformDeclarations = transformDeclarations;
|
|
@@ -115436,6 +115394,7 @@ var ts;
|
|
|
115436
115394
|
writeTrailingSemicolon();
|
|
115437
115395
|
}
|
|
115438
115396
|
function emitExportDeclaration(node) {
|
|
115397
|
+
emitModifiers(node, node.modifiers);
|
|
115439
115398
|
var nextPos = emitTokenWithComment(93 /* SyntaxKind.ExportKeyword */, node.pos, writeKeyword, node);
|
|
115440
115399
|
writeSpace();
|
|
115441
115400
|
if (node.isTypeOnly) {
|
|
@@ -118662,7 +118621,6 @@ var ts;
|
|
|
118662
118621
|
return resolutions;
|
|
118663
118622
|
}
|
|
118664
118623
|
ts.loadWithTypeDirectiveCache = loadWithTypeDirectiveCache;
|
|
118665
|
-
;
|
|
118666
118624
|
/**
|
|
118667
118625
|
* Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
|
|
118668
118626
|
* provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
|
|
@@ -123920,17 +123878,13 @@ var ts;
|
|
|
123920
123878
|
var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
|
|
123921
123879
|
return !!value && !!value.length;
|
|
123922
123880
|
}
|
|
123923
|
-
function createHasInvalidatedResolution(
|
|
123881
|
+
function createHasInvalidatedResolution(userProvidedHasInvalidatedResolution) {
|
|
123924
123882
|
// Ensure pending resolutions are applied
|
|
123925
123883
|
invalidateResolutionsOfFailedLookupLocations();
|
|
123926
|
-
if (forceAllFilesAsInvalidated) {
|
|
123927
|
-
// Any file asked would have invalidated resolution
|
|
123928
|
-
filesWithInvalidatedResolutions = undefined;
|
|
123929
|
-
return ts.returnTrue;
|
|
123930
|
-
}
|
|
123931
123884
|
var collected = filesWithInvalidatedResolutions;
|
|
123932
123885
|
filesWithInvalidatedResolutions = undefined;
|
|
123933
|
-
return function (path) { return (
|
|
123886
|
+
return function (path) { return (userProvidedHasInvalidatedResolution === null || userProvidedHasInvalidatedResolution === void 0 ? void 0 : userProvidedHasInvalidatedResolution(path)) ||
|
|
123887
|
+
!!(collected === null || collected === void 0 ? void 0 : collected.has(path)) ||
|
|
123934
123888
|
isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
|
|
123935
123889
|
}
|
|
123936
123890
|
function startCachingPerDirectoryResolution() {
|
|
@@ -125039,7 +124993,7 @@ var ts;
|
|
|
125039
124993
|
});
|
|
125040
124994
|
// Sort by paths closest to importing file Name directory
|
|
125041
124995
|
var sortedPaths = [];
|
|
125042
|
-
var
|
|
124996
|
+
var _loop_36 = function (directory) {
|
|
125043
124997
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
125044
124998
|
var pathsInDirectory;
|
|
125045
124999
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -125063,9 +125017,9 @@ var ts;
|
|
|
125063
125017
|
};
|
|
125064
125018
|
var out_directory_1;
|
|
125065
125019
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
125066
|
-
var
|
|
125020
|
+
var state_12 = _loop_36(directory);
|
|
125067
125021
|
directory = out_directory_1;
|
|
125068
|
-
if (
|
|
125022
|
+
if (state_12 === "break")
|
|
125069
125023
|
break;
|
|
125070
125024
|
}
|
|
125071
125025
|
if (allFileNames.size) {
|
|
@@ -125134,7 +125088,7 @@ var ts;
|
|
|
125134
125088
|
}
|
|
125135
125089
|
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
|
|
125136
125090
|
for (var key in paths) {
|
|
125137
|
-
var
|
|
125091
|
+
var _loop_37 = function (patternText_1) {
|
|
125138
125092
|
var pattern = ts.normalizePath(patternText_1);
|
|
125139
125093
|
var indexOfStar = pattern.indexOf("*");
|
|
125140
125094
|
// In module resolution, if `pattern` itself has an extension, a file with that extension is looked up directly,
|
|
@@ -125201,9 +125155,9 @@ var ts;
|
|
|
125201
125155
|
};
|
|
125202
125156
|
for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
|
|
125203
125157
|
var patternText_1 = _a[_i];
|
|
125204
|
-
var
|
|
125205
|
-
if (typeof
|
|
125206
|
-
return
|
|
125158
|
+
var state_13 = _loop_37(patternText_1);
|
|
125159
|
+
if (typeof state_13 === "object")
|
|
125160
|
+
return state_13.value;
|
|
125207
125161
|
}
|
|
125208
125162
|
}
|
|
125209
125163
|
function validateEnding(_a) {
|
|
@@ -125608,9 +125562,6 @@ var ts;
|
|
|
125608
125562
|
return "".concat(errorDiagnostic.file.fileName);
|
|
125609
125563
|
});
|
|
125610
125564
|
return filesInError.map(function (fileName) {
|
|
125611
|
-
if (fileName === undefined) {
|
|
125612
|
-
return undefined;
|
|
125613
|
-
}
|
|
125614
125565
|
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
125615
125566
|
return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
|
|
125616
125567
|
});
|
|
@@ -126247,8 +126198,6 @@ var ts;
|
|
|
126247
126198
|
parseConfigFile();
|
|
126248
126199
|
newLine = updateNewLine();
|
|
126249
126200
|
}
|
|
126250
|
-
ts.Debug.assert(compilerOptions);
|
|
126251
|
-
ts.Debug.assert(rootFileNames);
|
|
126252
126201
|
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
|
|
126253
126202
|
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
126254
126203
|
writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
|
|
@@ -126315,6 +126264,7 @@ var ts;
|
|
|
126315
126264
|
ts.maybeBind(host, host.getModuleResolutionCache) :
|
|
126316
126265
|
(function () { return resolutionCache.getModuleResolutionCache(); });
|
|
126317
126266
|
var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
126267
|
+
var userProvidedHasInvalidatedResolution = ts.maybeBind(host, host.hasInvalidatedResolution) || ts.returnTrue;
|
|
126318
126268
|
builderProgram = readBuilderProgram(compilerOptions, compilerHost);
|
|
126319
126269
|
synchronizeProgram();
|
|
126320
126270
|
// Update the wild card directory watch
|
|
@@ -126372,8 +126322,6 @@ var ts;
|
|
|
126372
126322
|
}
|
|
126373
126323
|
function synchronizeProgram() {
|
|
126374
126324
|
writeLog("Synchronizing program");
|
|
126375
|
-
ts.Debug.assert(compilerOptions);
|
|
126376
|
-
ts.Debug.assert(rootFileNames);
|
|
126377
126325
|
clearInvalidateResolutionsOfFailedLookupLocations();
|
|
126378
126326
|
var program = getCurrentBuilderProgram();
|
|
126379
126327
|
if (hasChangedCompilerOptions) {
|
|
@@ -126383,7 +126331,7 @@ var ts;
|
|
|
126383
126331
|
}
|
|
126384
126332
|
}
|
|
126385
126333
|
// All resolutions are invalid if user provided resolutions
|
|
126386
|
-
var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution);
|
|
126334
|
+
var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution ? userProvidedHasInvalidatedResolution : undefined);
|
|
126387
126335
|
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126388
126336
|
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126389
126337
|
if (hasChangedConfigFileParsingErrors) {
|
|
@@ -126622,8 +126570,6 @@ var ts;
|
|
|
126622
126570
|
}
|
|
126623
126571
|
function reloadFileNamesFromConfigFile() {
|
|
126624
126572
|
writeLog("Reloading new file names and options");
|
|
126625
|
-
ts.Debug.assert(compilerOptions);
|
|
126626
|
-
ts.Debug.assert(configFileName);
|
|
126627
126573
|
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
126628
126574
|
rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
|
126629
126575
|
if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
|
|
@@ -126633,7 +126579,6 @@ var ts;
|
|
|
126633
126579
|
synchronizeProgram();
|
|
126634
126580
|
}
|
|
126635
126581
|
function reloadConfigFile() {
|
|
126636
|
-
ts.Debug.assert(configFileName);
|
|
126637
126582
|
writeLog("Reloading config file: ".concat(configFileName));
|
|
126638
126583
|
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
126639
126584
|
if (cachedDirectoryStructureHost) {
|
|
@@ -126648,7 +126593,6 @@ var ts;
|
|
|
126648
126593
|
updateExtendedConfigFilesWatches(toPath(configFileName), compilerOptions, watchOptions, ts.WatchType.ExtendedConfigFile);
|
|
126649
126594
|
}
|
|
126650
126595
|
function parseConfigFile() {
|
|
126651
|
-
ts.Debug.assert(configFileName);
|
|
126652
126596
|
setConfigFileParsingResult(ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost, extendedConfigCache || (extendedConfigCache = new ts.Map()), watchOptionsToExtend, extraFileExtensions)); // TODO: GH#18217
|
|
126653
126597
|
}
|
|
126654
126598
|
function setConfigFileParsingResult(configFileParseResult) {
|
|
@@ -126670,7 +126614,6 @@ var ts;
|
|
|
126670
126614
|
// With host implementing getParsedCommandLine we cant just update file names
|
|
126671
126615
|
if (config.parsedCommandLine && config.reloadLevel === ts.ConfigFileProgramReloadLevel.Partial && !host.getParsedCommandLine) {
|
|
126672
126616
|
writeLog("Reloading new file names and options");
|
|
126673
|
-
ts.Debug.assert(compilerOptions);
|
|
126674
126617
|
var fileNames = ts.getFileNamesFromConfigSpecs(config.parsedCommandLine.options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost);
|
|
126675
126618
|
config.parsedCommandLine = __assign(__assign({}, config.parsedCommandLine), { fileNames: fileNames });
|
|
126676
126619
|
config.reloadLevel = undefined;
|
|
@@ -126757,8 +126700,7 @@ var ts;
|
|
|
126757
126700
|
}
|
|
126758
126701
|
function watchWildcardDirectory(directory, flags) {
|
|
126759
126702
|
return watchDirectory(directory, function (fileOrDirectory) {
|
|
126760
|
-
ts.Debug.assert(configFileName);
|
|
126761
|
-
ts.Debug.assert(compilerOptions);
|
|
126703
|
+
ts.Debug.assert(!!configFileName);
|
|
126762
126704
|
var fileOrDirectoryPath = toPath(fileOrDirectory);
|
|
126763
126705
|
// Since the file existence changed, update the sourceFiles cache
|
|
126764
126706
|
if (cachedDirectoryStructureHost) {
|
|
@@ -126788,7 +126730,6 @@ var ts;
|
|
|
126788
126730
|
}, flags, watchOptions, ts.WatchType.WildcardDirectory);
|
|
126789
126731
|
}
|
|
126790
126732
|
function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions, watchType) {
|
|
126791
|
-
ts.Debug.assert(configFileName);
|
|
126792
126733
|
ts.updateSharedExtendedConfigFileWatcher(forProjectPath, options, sharedExtendedConfigFileWatchers || (sharedExtendedConfigFileWatchers = new ts.Map()), function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(extendedConfigFileName, function (_fileName, eventKind) {
|
|
126793
126734
|
var _a;
|
|
126794
126735
|
updateCachedSystemWithFile(extendedConfigFileName, extendedConfigFilePath, eventKind);
|
|
@@ -129206,7 +129147,7 @@ var ts;
|
|
|
129206
129147
|
ProjectWatcherType["DirectoryWatcher"] = "DirectoryWatcher";
|
|
129207
129148
|
})(ProjectWatcherType || (ProjectWatcherType = {}));
|
|
129208
129149
|
function getDetailWatchInfo(projectName, watchers) {
|
|
129209
|
-
return "Project: ".concat(projectName, " watcher already invoked: ").concat(watchers
|
|
129150
|
+
return "Project: ".concat(projectName, " watcher already invoked: ").concat(watchers.isInvoked);
|
|
129210
129151
|
}
|
|
129211
129152
|
var TypingsInstaller = /** @class */ (function () {
|
|
129212
129153
|
function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, typesMapLocation, throttleLimit, log) {
|