@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/tsserverlibrary.js
CHANGED
|
@@ -108,7 +108,7 @@ var ts;
|
|
|
108
108
|
// The following is baselined as a literal template type without intervention
|
|
109
109
|
/** The version of the TypeScript compiler release */
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
111
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.
|
|
111
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20220922");
|
|
112
112
|
/* @internal */
|
|
113
113
|
var Comparison;
|
|
114
114
|
(function (Comparison) {
|
|
@@ -297,6 +297,11 @@ var ts;
|
|
|
297
297
|
return result;
|
|
298
298
|
}
|
|
299
299
|
ts.intersperse = intersperse;
|
|
300
|
+
/**
|
|
301
|
+
* Iterates through `array` by index and performs the callback on each element of array until the callback
|
|
302
|
+
* returns a falsey value, then returns false.
|
|
303
|
+
* If no such value is found, the callback is applied to each element of array and `true` is returned.
|
|
304
|
+
*/
|
|
300
305
|
function every(array, callback) {
|
|
301
306
|
if (array) {
|
|
302
307
|
for (var i = 0; i < array.length; i++) {
|
|
@@ -308,10 +313,6 @@ var ts;
|
|
|
308
313
|
return true;
|
|
309
314
|
}
|
|
310
315
|
ts.every = every;
|
|
311
|
-
function isArrayOf(array, callback) {
|
|
312
|
-
return every(array, callback);
|
|
313
|
-
}
|
|
314
|
-
ts.isArrayOf = isArrayOf;
|
|
315
316
|
function find(array, predicate, startIndex) {
|
|
316
317
|
if (array === undefined)
|
|
317
318
|
return undefined;
|
|
@@ -988,7 +989,6 @@ var ts;
|
|
|
988
989
|
}
|
|
989
990
|
ts.sum = sum;
|
|
990
991
|
function append(to, value) {
|
|
991
|
-
// If to is Push<T>, return value is void, so safe to cast to T[].
|
|
992
992
|
if (value === undefined)
|
|
993
993
|
return to;
|
|
994
994
|
if (to === undefined)
|
|
@@ -2692,7 +2692,7 @@ var ts;
|
|
|
2692
2692
|
if (typeof func !== "function") {
|
|
2693
2693
|
return "";
|
|
2694
2694
|
}
|
|
2695
|
-
else if (
|
|
2695
|
+
else if (ts.hasProperty(func, "name")) {
|
|
2696
2696
|
return func.name;
|
|
2697
2697
|
}
|
|
2698
2698
|
else {
|
|
@@ -3017,7 +3017,7 @@ var ts;
|
|
|
3017
3017
|
];
|
|
3018
3018
|
for (var _i = 0, nodeConstructors_1 = nodeConstructors; _i < nodeConstructors_1.length; _i++) {
|
|
3019
3019
|
var ctor = nodeConstructors_1[_i];
|
|
3020
|
-
if (!ctor.prototype
|
|
3020
|
+
if (!ts.hasProperty(ctor.prototype, "__debugKind")) {
|
|
3021
3021
|
Object.defineProperties(ctor.prototype, {
|
|
3022
3022
|
// for use with vscode-js-debug's new customDescriptionGenerator in launch.json
|
|
3023
3023
|
__tsDebuggerDisplay: {
|
|
@@ -3872,7 +3872,6 @@ var ts;
|
|
|
3872
3872
|
var typeCatalog = []; // NB: id is index + 1
|
|
3873
3873
|
var legendPath;
|
|
3874
3874
|
var legend = [];
|
|
3875
|
-
;
|
|
3876
3875
|
/** Starts tracing for the given project. */
|
|
3877
3876
|
function startTracing(tracingMode, traceDir, configFilePath) {
|
|
3878
3877
|
ts.Debug.assert(!ts.tracing, "Tracing already started");
|
|
@@ -8704,8 +8703,6 @@ var ts;
|
|
|
8704
8703
|
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."),
|
|
8705
8704
|
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."),
|
|
8706
8705
|
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."),
|
|
8707
|
-
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'."),
|
|
8708
|
-
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."),
|
|
8709
8706
|
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."),
|
|
8710
8707
|
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."),
|
|
8711
8708
|
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."),
|
|
@@ -8954,6 +8951,7 @@ var ts;
|
|
|
8954
8951
|
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."),
|
|
8955
8952
|
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."),
|
|
8956
8953
|
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."),
|
|
8954
|
+
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."),
|
|
8957
8955
|
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."),
|
|
8958
8956
|
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."),
|
|
8959
8957
|
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."),
|
|
@@ -9134,6 +9132,7 @@ var ts;
|
|
|
9134
9132
|
_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?"),
|
|
9135
9133
|
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."),
|
|
9136
9134
|
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."),
|
|
9135
|
+
This_condition_will_always_return_0: diag(2845, ts.DiagnosticCategory.Error, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."),
|
|
9137
9136
|
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}'."),
|
|
9138
9137
|
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}'."),
|
|
9139
9138
|
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}'."),
|
|
@@ -10076,6 +10075,8 @@ var ts;
|
|
|
10076
10075
|
Delete_unused_param_tag_0: diag(95171, ts.DiagnosticCategory.Message, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"),
|
|
10077
10076
|
Delete_all_unused_param_tags: diag(95172, ts.DiagnosticCategory.Message, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"),
|
|
10078
10077
|
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}'"),
|
|
10078
|
+
Use_0: diag(95174, ts.DiagnosticCategory.Message, "Use_0_95174", "Use `{0}`."),
|
|
10079
|
+
Use_Number_isNaN_in_all_conditions: diag(95175, ts.DiagnosticCategory.Message, "Use_Number_isNaN_in_all_conditions_95175", "Use `Number.isNaN` in all conditions."),
|
|
10079
10080
|
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."),
|
|
10080
10081
|
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'."),
|
|
10081
10082
|
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?"),
|
|
@@ -10337,7 +10338,7 @@ var ts;
|
|
|
10337
10338
|
ts.stringToToken = stringToToken;
|
|
10338
10339
|
/* @internal */
|
|
10339
10340
|
function computeLineStarts(text) {
|
|
10340
|
-
var result =
|
|
10341
|
+
var result = [];
|
|
10341
10342
|
var pos = 0;
|
|
10342
10343
|
var lineStart = 0;
|
|
10343
10344
|
while (pos < text.length) {
|
|
@@ -10814,7 +10815,9 @@ var ts;
|
|
|
10814
10815
|
}
|
|
10815
10816
|
ts.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange;
|
|
10816
10817
|
function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) {
|
|
10817
|
-
if (comments
|
|
10818
|
+
if (!comments) {
|
|
10819
|
+
comments = [];
|
|
10820
|
+
}
|
|
10818
10821
|
comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine });
|
|
10819
10822
|
return comments;
|
|
10820
10823
|
}
|
|
@@ -11896,12 +11899,36 @@ var ts;
|
|
|
11896
11899
|
pos++;
|
|
11897
11900
|
return token = 0 /* SyntaxKind.Unknown */;
|
|
11898
11901
|
}
|
|
11899
|
-
|
|
11902
|
+
var charAfterHash = codePointAt(text, pos + 1);
|
|
11903
|
+
if (charAfterHash === 92 /* CharacterCodes.backslash */) {
|
|
11904
|
+
pos++;
|
|
11905
|
+
var extendedCookedChar_1 = peekExtendedUnicodeEscape();
|
|
11906
|
+
if (extendedCookedChar_1 >= 0 && isIdentifierStart(extendedCookedChar_1, languageVersion)) {
|
|
11907
|
+
pos += 3;
|
|
11908
|
+
tokenFlags |= 8 /* TokenFlags.ExtendedUnicodeEscape */;
|
|
11909
|
+
tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
11910
|
+
return token = 80 /* SyntaxKind.PrivateIdentifier */;
|
|
11911
|
+
}
|
|
11912
|
+
var cookedChar_1 = peekUnicodeEscape();
|
|
11913
|
+
if (cookedChar_1 >= 0 && isIdentifierStart(cookedChar_1, languageVersion)) {
|
|
11914
|
+
pos += 6;
|
|
11915
|
+
tokenFlags |= 1024 /* TokenFlags.UnicodeEscape */;
|
|
11916
|
+
tokenValue = "#" + String.fromCharCode(cookedChar_1) + scanIdentifierParts();
|
|
11917
|
+
return token = 80 /* SyntaxKind.PrivateIdentifier */;
|
|
11918
|
+
}
|
|
11919
|
+
pos--;
|
|
11920
|
+
}
|
|
11921
|
+
if (isIdentifierStart(charAfterHash, languageVersion)) {
|
|
11900
11922
|
pos++;
|
|
11901
|
-
scanIdentifier
|
|
11923
|
+
// We're relying on scanIdentifier's behavior and adjusting the token kind after the fact.
|
|
11924
|
+
// Notably absent from this block is the fact that calling a function named "scanIdentifier",
|
|
11925
|
+
// but identifiers don't include '#', and that function doesn't deal with it at all.
|
|
11926
|
+
// This works because 'scanIdentifier' tries to reuse source characters and builds up substrings;
|
|
11927
|
+
// however, it starts at the 'tokenPos' which includes the '#', and will "accidentally" prepend the '#' for us.
|
|
11928
|
+
scanIdentifier(charAfterHash, languageVersion);
|
|
11902
11929
|
}
|
|
11903
11930
|
else {
|
|
11904
|
-
tokenValue =
|
|
11931
|
+
tokenValue = "#";
|
|
11905
11932
|
error(ts.Diagnostics.Invalid_character, pos++, charSize(ch));
|
|
11906
11933
|
}
|
|
11907
11934
|
return token = 80 /* SyntaxKind.PrivateIdentifier */;
|
|
@@ -12672,8 +12699,6 @@ var ts;
|
|
|
12672
12699
|
return false;
|
|
12673
12700
|
}
|
|
12674
12701
|
ts.isEmptyBindingPattern = isEmptyBindingPattern;
|
|
12675
|
-
// TODO(jakebailey): It is very weird that we have BindingElement and ArrayBindingElement;
|
|
12676
|
-
// we should have ObjectBindingElement and ArrayBindingElement, which are both BindingElement.
|
|
12677
12702
|
function isEmptyBindingElement(node) {
|
|
12678
12703
|
if (ts.isOmittedExpression(node)) {
|
|
12679
12704
|
return true;
|
|
@@ -12792,10 +12817,7 @@ var ts;
|
|
|
12792
12817
|
node = node.original;
|
|
12793
12818
|
}
|
|
12794
12819
|
}
|
|
12795
|
-
|
|
12796
|
-
return node;
|
|
12797
|
-
}
|
|
12798
|
-
return nodeTest(node) ? node : undefined;
|
|
12820
|
+
return !nodeTest || nodeTest(node) ? node : undefined;
|
|
12799
12821
|
}
|
|
12800
12822
|
ts.getOriginalNode = getOriginalNode;
|
|
12801
12823
|
function findAncestor(node, callback) {
|
|
@@ -13473,7 +13495,7 @@ var ts;
|
|
|
13473
13495
|
// Node Arrays
|
|
13474
13496
|
/* @internal */
|
|
13475
13497
|
function isNodeArray(array) {
|
|
13476
|
-
return
|
|
13498
|
+
return ts.hasProperty(array, "pos") && ts.hasProperty(array, "end");
|
|
13477
13499
|
}
|
|
13478
13500
|
ts.isNodeArray = isNodeArray;
|
|
13479
13501
|
// Literals
|
|
@@ -13821,13 +13843,6 @@ var ts;
|
|
|
13821
13843
|
return false;
|
|
13822
13844
|
}
|
|
13823
13845
|
ts.isDeclarationBindingElement = isDeclarationBindingElement;
|
|
13824
|
-
function isBindingOrAssignmentElement(node) {
|
|
13825
|
-
return ts.isVariableDeclaration(node)
|
|
13826
|
-
|| ts.isParameter(node)
|
|
13827
|
-
|| isObjectBindingOrAssignmentElement(node)
|
|
13828
|
-
|| isArrayBindingOrAssignmentElement(node);
|
|
13829
|
-
}
|
|
13830
|
-
ts.isBindingOrAssignmentElement = isBindingOrAssignmentElement;
|
|
13831
13846
|
/**
|
|
13832
13847
|
* Determines whether a node is a BindingOrAssignmentPattern
|
|
13833
13848
|
*/
|
|
@@ -13876,22 +13891,6 @@ var ts;
|
|
|
13876
13891
|
}
|
|
13877
13892
|
ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern;
|
|
13878
13893
|
/* @internal */
|
|
13879
|
-
function isArrayBindingOrAssignmentElement(node) {
|
|
13880
|
-
switch (node.kind) {
|
|
13881
|
-
case 205 /* SyntaxKind.BindingElement */:
|
|
13882
|
-
case 229 /* SyntaxKind.OmittedExpression */: // Elision
|
|
13883
|
-
case 227 /* SyntaxKind.SpreadElement */: // AssignmentRestElement
|
|
13884
|
-
case 206 /* SyntaxKind.ArrayLiteralExpression */: // ArrayAssignmentPattern
|
|
13885
|
-
case 207 /* SyntaxKind.ObjectLiteralExpression */: // ObjectAssignmentPattern
|
|
13886
|
-
case 79 /* SyntaxKind.Identifier */: // DestructuringAssignmentTarget
|
|
13887
|
-
case 208 /* SyntaxKind.PropertyAccessExpression */: // DestructuringAssignmentTarget
|
|
13888
|
-
case 209 /* SyntaxKind.ElementAccessExpression */: // DestructuringAssignmentTarget
|
|
13889
|
-
return true;
|
|
13890
|
-
}
|
|
13891
|
-
return ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true); // AssignmentElement
|
|
13892
|
-
}
|
|
13893
|
-
ts.isArrayBindingOrAssignmentElement = isArrayBindingOrAssignmentElement;
|
|
13894
|
-
/* @internal */
|
|
13895
13894
|
function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
|
|
13896
13895
|
var kind = node.kind;
|
|
13897
13896
|
return kind === 208 /* SyntaxKind.PropertyAccessExpression */
|
|
@@ -14004,23 +14003,6 @@ var ts;
|
|
|
14004
14003
|
}
|
|
14005
14004
|
}
|
|
14006
14005
|
ts.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite;
|
|
14007
|
-
/**
|
|
14008
|
-
* See isExpression; not for use in transforms.
|
|
14009
|
-
* @internal
|
|
14010
|
-
*/
|
|
14011
|
-
function isLiteralTypeLiteral(node) {
|
|
14012
|
-
node = skipPartiallyEmittedExpressions(node);
|
|
14013
|
-
switch (skipPartiallyEmittedExpressions(node).kind) {
|
|
14014
|
-
case 104 /* SyntaxKind.NullKeyword */:
|
|
14015
|
-
case 110 /* SyntaxKind.TrueKeyword */:
|
|
14016
|
-
case 95 /* SyntaxKind.FalseKeyword */:
|
|
14017
|
-
case 221 /* SyntaxKind.PrefixUnaryExpression */:
|
|
14018
|
-
return true;
|
|
14019
|
-
default:
|
|
14020
|
-
return isLiteralExpression(node);
|
|
14021
|
-
}
|
|
14022
|
-
}
|
|
14023
|
-
ts.isLiteralTypeLiteral = isLiteralTypeLiteral;
|
|
14024
14006
|
/* @internal */
|
|
14025
14007
|
/**
|
|
14026
14008
|
* Determines whether a node is an expression based only on its kind.
|
|
@@ -14985,7 +14967,6 @@ var ts;
|
|
|
14985
14967
|
return emitNode && emitNode.flags || 0;
|
|
14986
14968
|
}
|
|
14987
14969
|
ts.getEmitFlags = getEmitFlags;
|
|
14988
|
-
;
|
|
14989
14970
|
function getScriptTargetFeatures() {
|
|
14990
14971
|
return {
|
|
14991
14972
|
es2015: {
|
|
@@ -15300,7 +15281,6 @@ var ts;
|
|
|
15300
15281
|
}
|
|
15301
15282
|
ts.isBlockScope = isBlockScope;
|
|
15302
15283
|
function isDeclarationWithTypeParameters(node) {
|
|
15303
|
-
ts.Debug.type(node);
|
|
15304
15284
|
switch (node.kind) {
|
|
15305
15285
|
case 341 /* SyntaxKind.JSDocCallbackTag */:
|
|
15306
15286
|
case 348 /* SyntaxKind.JSDocTypedefTag */:
|
|
@@ -15313,7 +15293,6 @@ var ts;
|
|
|
15313
15293
|
}
|
|
15314
15294
|
ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;
|
|
15315
15295
|
function isDeclarationWithTypeParameterChildren(node) {
|
|
15316
|
-
ts.Debug.type(node);
|
|
15317
15296
|
switch (node.kind) {
|
|
15318
15297
|
case 176 /* SyntaxKind.CallSignature */:
|
|
15319
15298
|
case 177 /* SyntaxKind.ConstructSignature */:
|
|
@@ -17772,10 +17751,6 @@ var ts;
|
|
|
17772
17751
|
return node.escapedText === "push" || node.escapedText === "unshift";
|
|
17773
17752
|
}
|
|
17774
17753
|
ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
|
|
17775
|
-
// TODO(jakebailey): this function should not be named this. While it does technically
|
|
17776
|
-
// return true if the argument is a ParameterDeclaration, it also returns true for nodes
|
|
17777
|
-
// that are children of ParameterDeclarations inside binding elements.
|
|
17778
|
-
// Probably, this should be called `rootDeclarationIsParameter`.
|
|
17779
17754
|
function isParameterDeclaration(node) {
|
|
17780
17755
|
var root = getRootDeclaration(node);
|
|
17781
17756
|
return root.kind === 166 /* SyntaxKind.Parameter */;
|
|
@@ -19717,7 +19692,7 @@ var ts;
|
|
|
19717
19692
|
}
|
|
19718
19693
|
function isWatchSet(options) {
|
|
19719
19694
|
// Firefox has Object.prototype.watch
|
|
19720
|
-
return options.watch &&
|
|
19695
|
+
return options.watch && ts.hasProperty(options, "watch");
|
|
19721
19696
|
}
|
|
19722
19697
|
ts.isWatchSet = isWatchSet;
|
|
19723
19698
|
function closeFileWatcher(watcher) {
|
|
@@ -19965,7 +19940,6 @@ var ts;
|
|
|
19965
19940
|
|| kind === 114 /* SyntaxKind.VoidKeyword */
|
|
19966
19941
|
|| kind === 155 /* SyntaxKind.UndefinedKeyword */
|
|
19967
19942
|
|| kind === 144 /* SyntaxKind.NeverKeyword */
|
|
19968
|
-
|| kind === 139 /* SyntaxKind.IntrinsicKeyword */
|
|
19969
19943
|
|| kind === 230 /* SyntaxKind.ExpressionWithTypeArguments */
|
|
19970
19944
|
|| kind === 315 /* SyntaxKind.JSDocAllType */
|
|
19971
19945
|
|| kind === 316 /* SyntaxKind.JSDocUnknownType */
|
|
@@ -22277,11 +22251,6 @@ var ts;
|
|
|
22277
22251
|
}
|
|
22278
22252
|
}
|
|
22279
22253
|
ts.createParenthesizerRules = createParenthesizerRules;
|
|
22280
|
-
function castToNodeArray(nodes) {
|
|
22281
|
-
// TODO(jakebailey): Why do we need this helper? GH#49924?
|
|
22282
|
-
// Also, why can't I write `isNodeArray<T>` as an expression?
|
|
22283
|
-
return ts.cast(nodes, ts.isNodeArray);
|
|
22284
|
-
}
|
|
22285
22254
|
ts.nullParenthesizerRules = {
|
|
22286
22255
|
getParenthesizeLeftSideOfBinaryForOperator: function (_) { return ts.identity; },
|
|
22287
22256
|
getParenthesizeRightSideOfBinaryForOperator: function (_) { return ts.identity; },
|
|
@@ -22295,23 +22264,23 @@ var ts;
|
|
|
22295
22264
|
parenthesizeLeftSideOfAccess: function (expression) { return ts.cast(expression, ts.isLeftHandSideExpression); },
|
|
22296
22265
|
parenthesizeOperandOfPostfixUnary: function (operand) { return ts.cast(operand, ts.isLeftHandSideExpression); },
|
|
22297
22266
|
parenthesizeOperandOfPrefixUnary: function (operand) { return ts.cast(operand, ts.isUnaryExpression); },
|
|
22298
|
-
parenthesizeExpressionsOfCommaDelimitedList:
|
|
22267
|
+
parenthesizeExpressionsOfCommaDelimitedList: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
22299
22268
|
parenthesizeExpressionForDisallowedComma: ts.identity,
|
|
22300
22269
|
parenthesizeExpressionOfExpressionStatement: ts.identity,
|
|
22301
22270
|
parenthesizeConciseBodyOfArrowFunction: ts.identity,
|
|
22302
22271
|
parenthesizeCheckTypeOfConditionalType: ts.identity,
|
|
22303
22272
|
parenthesizeExtendsTypeOfConditionalType: ts.identity,
|
|
22304
|
-
parenthesizeConstituentTypesOfUnionType:
|
|
22273
|
+
parenthesizeConstituentTypesOfUnionType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
22305
22274
|
parenthesizeConstituentTypeOfUnionType: ts.identity,
|
|
22306
|
-
parenthesizeConstituentTypesOfIntersectionType:
|
|
22275
|
+
parenthesizeConstituentTypesOfIntersectionType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
22307
22276
|
parenthesizeConstituentTypeOfIntersectionType: ts.identity,
|
|
22308
22277
|
parenthesizeOperandOfTypeOperator: ts.identity,
|
|
22309
22278
|
parenthesizeOperandOfReadonlyTypeOperator: ts.identity,
|
|
22310
22279
|
parenthesizeNonArrayTypeOfPostfixType: ts.identity,
|
|
22311
|
-
parenthesizeElementTypesOfTupleType:
|
|
22280
|
+
parenthesizeElementTypesOfTupleType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
|
|
22312
22281
|
parenthesizeElementTypeOfTupleType: ts.identity,
|
|
22313
22282
|
parenthesizeTypeOfOptionalType: ts.identity,
|
|
22314
|
-
parenthesizeTypeArguments: function (nodes) { return nodes &&
|
|
22283
|
+
parenthesizeTypeArguments: function (nodes) { return nodes && ts.cast(nodes, ts.isNodeArray); },
|
|
22315
22284
|
parenthesizeLeadingTypeArgument: ts.identity,
|
|
22316
22285
|
};
|
|
22317
22286
|
})(ts || (ts = {}));
|
|
@@ -27008,7 +26977,7 @@ var ts;
|
|
|
27008
26977
|
clone.transformFlags = node.transformFlags;
|
|
27009
26978
|
setOriginalNode(clone, node);
|
|
27010
26979
|
for (var key in node) {
|
|
27011
|
-
if (
|
|
26980
|
+
if (ts.hasProperty(clone, key) || !ts.hasProperty(node, key)) {
|
|
27012
26981
|
continue;
|
|
27013
26982
|
}
|
|
27014
26983
|
clone[key] = node[key];
|
|
@@ -31896,7 +31865,6 @@ var ts;
|
|
|
31896
31865
|
visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
31897
31866
|
visitNode(cbNode, node.type);
|
|
31898
31867
|
}
|
|
31899
|
-
;
|
|
31900
31868
|
function forEachChildInUnionOrIntersectionType(node, cbNode, cbNodes) {
|
|
31901
31869
|
return visitNodes(cbNode, cbNodes, node.types);
|
|
31902
31870
|
}
|
|
@@ -33198,7 +33166,7 @@ var ts;
|
|
|
33198
33166
|
}
|
|
33199
33167
|
function parsePrivateIdentifier() {
|
|
33200
33168
|
var pos = getNodePos();
|
|
33201
|
-
var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.
|
|
33169
|
+
var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenValue()));
|
|
33202
33170
|
nextToken();
|
|
33203
33171
|
return finishNode(node, pos);
|
|
33204
33172
|
}
|
|
@@ -39296,8 +39264,8 @@ var ts;
|
|
|
39296
39264
|
}
|
|
39297
39265
|
}
|
|
39298
39266
|
}
|
|
39299
|
-
function moveElementEntirelyPastChangeRange(element, delta, oldText, newText, aggressiveChecks) {
|
|
39300
|
-
if (
|
|
39267
|
+
function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) {
|
|
39268
|
+
if (isArray) {
|
|
39301
39269
|
visitArray(element);
|
|
39302
39270
|
}
|
|
39303
39271
|
else {
|
|
@@ -39305,7 +39273,6 @@ var ts;
|
|
|
39305
39273
|
}
|
|
39306
39274
|
return;
|
|
39307
39275
|
function visitNode(node) {
|
|
39308
|
-
ts.Debug.type(node);
|
|
39309
39276
|
var text = "";
|
|
39310
39277
|
if (aggressiveChecks && shouldCheckNode(node)) {
|
|
39311
39278
|
text = oldText.substring(node.pos, node.end);
|
|
@@ -39329,7 +39296,6 @@ var ts;
|
|
|
39329
39296
|
checkNodePositions(node, aggressiveChecks);
|
|
39330
39297
|
}
|
|
39331
39298
|
function visitArray(array) {
|
|
39332
|
-
ts.Debug.type(array);
|
|
39333
39299
|
array._children = undefined;
|
|
39334
39300
|
ts.setTextRangePosEnd(array, array.pos + delta, array.end + delta);
|
|
39335
39301
|
for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
|
|
@@ -39435,12 +39401,11 @@ var ts;
|
|
|
39435
39401
|
visitNode(sourceFile);
|
|
39436
39402
|
return;
|
|
39437
39403
|
function visitNode(child) {
|
|
39438
|
-
ts.Debug.type(child);
|
|
39439
39404
|
ts.Debug.assert(child.pos <= child.end);
|
|
39440
39405
|
if (child.pos > changeRangeOldEnd) {
|
|
39441
39406
|
// Node is entirely past the change range. We need to move both its pos and
|
|
39442
39407
|
// end, forward or backward appropriately.
|
|
39443
|
-
moveElementEntirelyPastChangeRange(child, delta, oldText, newText, aggressiveChecks);
|
|
39408
|
+
moveElementEntirelyPastChangeRange(child, /*isArray*/ false, delta, oldText, newText, aggressiveChecks);
|
|
39444
39409
|
return;
|
|
39445
39410
|
}
|
|
39446
39411
|
// Check if the element intersects the change range. If it does, then it is not
|
|
@@ -39466,12 +39431,11 @@ var ts;
|
|
|
39466
39431
|
ts.Debug.assert(fullEnd < changeStart);
|
|
39467
39432
|
}
|
|
39468
39433
|
function visitArray(array) {
|
|
39469
|
-
ts.Debug.type(array);
|
|
39470
39434
|
ts.Debug.assert(array.pos <= array.end);
|
|
39471
39435
|
if (array.pos > changeRangeOldEnd) {
|
|
39472
39436
|
// Array is entirely after the change range. We need to move it, and move any of
|
|
39473
39437
|
// its children.
|
|
39474
|
-
moveElementEntirelyPastChangeRange(array, delta, oldText, newText, aggressiveChecks);
|
|
39438
|
+
moveElementEntirelyPastChangeRange(array, /*isArray*/ true, delta, oldText, newText, aggressiveChecks);
|
|
39475
39439
|
return;
|
|
39476
39440
|
}
|
|
39477
39441
|
// Check if the element intersects the change range. If it does, then it is not
|
|
@@ -43073,7 +43037,6 @@ var ts;
|
|
|
43073
43037
|
}
|
|
43074
43038
|
}
|
|
43075
43039
|
function specToDiagnostic(spec, disallowTrailingRecursion) {
|
|
43076
|
-
ts.Debug.assert(typeof spec === "string");
|
|
43077
43040
|
if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
|
|
43078
43041
|
return [ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
|
|
43079
43042
|
}
|
|
@@ -43217,7 +43180,7 @@ var ts;
|
|
|
43217
43180
|
function convertCompilerOptionsForTelemetry(opts) {
|
|
43218
43181
|
var out = {};
|
|
43219
43182
|
for (var key in opts) {
|
|
43220
|
-
if (
|
|
43183
|
+
if (ts.hasProperty(opts, key)) {
|
|
43221
43184
|
var type = getOptionFromName(key);
|
|
43222
43185
|
if (type !== undefined) { // Ignore unknown options
|
|
43223
43186
|
out[key] = getOptionValueWithEmptyStrings(opts[key], type);
|
|
@@ -45289,6 +45252,7 @@ var ts;
|
|
|
45289
45252
|
}
|
|
45290
45253
|
}
|
|
45291
45254
|
function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
|
|
45255
|
+
var _a;
|
|
45292
45256
|
var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));
|
|
45293
45257
|
// First look for a nested package.json, as in `node_modules/foo/bar/package.json`.
|
|
45294
45258
|
var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
|
|
@@ -45303,13 +45267,7 @@ var ts;
|
|
|
45303
45267
|
return withPackageId(packageInfo, fromDirectory);
|
|
45304
45268
|
}
|
|
45305
45269
|
}
|
|
45306
|
-
var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
|
|
45307
45270
|
var loader = function (extensions, candidate, onlyRecordFailures, state) {
|
|
45308
|
-
var _a;
|
|
45309
|
-
// package exports are higher priority than file/directory lookups (and, if there's exports present, blocks them)
|
|
45310
|
-
if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
|
|
45311
|
-
return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
45312
|
-
}
|
|
45313
45271
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
45314
45272
|
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths);
|
|
45315
45273
|
if (!pathAndExtension && packageInfo
|
|
@@ -45322,19 +45280,24 @@ var ts;
|
|
|
45322
45280
|
}
|
|
45323
45281
|
return withPackageId(packageInfo, pathAndExtension);
|
|
45324
45282
|
};
|
|
45325
|
-
|
|
45326
|
-
|
|
45327
|
-
|
|
45283
|
+
var _b = parsePackageName(moduleName), packageName = _b.packageName, rest = _b.rest;
|
|
45284
|
+
var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
|
|
45285
|
+
if (rest !== "") {
|
|
45286
|
+
// Previous `packageInfo` may have been from a nested package.json; ensure we have the one from the package root now.
|
|
45328
45287
|
packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
|
|
45329
|
-
|
|
45330
|
-
|
|
45331
|
-
|
|
45332
|
-
|
|
45333
|
-
|
|
45334
|
-
|
|
45335
|
-
|
|
45336
|
-
|
|
45337
|
-
|
|
45288
|
+
}
|
|
45289
|
+
// package exports are higher priority than file/directory/typesVersions lookups and (and, if there's exports present, blocks them)
|
|
45290
|
+
if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
|
|
45291
|
+
return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
45292
|
+
}
|
|
45293
|
+
if (rest !== "" && packageInfo && packageInfo.contents.versionPaths) {
|
|
45294
|
+
if (state.traceEnabled) {
|
|
45295
|
+
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);
|
|
45296
|
+
}
|
|
45297
|
+
var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
|
|
45298
|
+
var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
|
|
45299
|
+
if (fromPaths) {
|
|
45300
|
+
return fromPaths.value;
|
|
45338
45301
|
}
|
|
45339
45302
|
}
|
|
45340
45303
|
return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
|
|
@@ -49721,7 +49684,8 @@ var ts;
|
|
|
49721
49684
|
var emptyTypeLiteralSymbol = createSymbol(2048 /* SymbolFlags.TypeLiteral */, "__type" /* InternalSymbolName.Type */);
|
|
49722
49685
|
emptyTypeLiteralSymbol.members = ts.createSymbolTable();
|
|
49723
49686
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
49724
|
-
var
|
|
49687
|
+
var unknownEmptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
49688
|
+
var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType;
|
|
49725
49689
|
var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
49726
49690
|
emptyGenericType.instantiations = new ts.Map();
|
|
49727
49691
|
var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
@@ -49835,6 +49799,8 @@ var ts;
|
|
|
49835
49799
|
var deferredGlobalOmitSymbol;
|
|
49836
49800
|
var deferredGlobalAwaitedSymbol;
|
|
49837
49801
|
var deferredGlobalBigIntType;
|
|
49802
|
+
var deferredGlobalNaNSymbol;
|
|
49803
|
+
var deferredGlobalRecordSymbol;
|
|
49838
49804
|
var allPotentiallyUnusedIdentifiers = new ts.Map(); // key is file name
|
|
49839
49805
|
var flowLoopStart = 0;
|
|
49840
49806
|
var flowLoopCount = 0;
|
|
@@ -49919,7 +49885,7 @@ var ts;
|
|
|
49919
49885
|
if (jsxFragmentPragma) {
|
|
49920
49886
|
var chosenPragma = ts.isArray(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma;
|
|
49921
49887
|
file.localJsxFragmentFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
|
|
49922
|
-
ts.visitNode(file.localJsxFragmentFactory, markAsSynthetic
|
|
49888
|
+
ts.visitNode(file.localJsxFragmentFactory, markAsSynthetic);
|
|
49923
49889
|
if (file.localJsxFragmentFactory) {
|
|
49924
49890
|
return file.localJsxFragmentNamespace = ts.getFirstIdentifier(file.localJsxFragmentFactory).escapedText;
|
|
49925
49891
|
}
|
|
@@ -49964,7 +49930,7 @@ var ts;
|
|
|
49964
49930
|
if (jsxPragma) {
|
|
49965
49931
|
var chosenPragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma;
|
|
49966
49932
|
file.localJsxFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
|
|
49967
|
-
ts.visitNode(file.localJsxFactory, markAsSynthetic
|
|
49933
|
+
ts.visitNode(file.localJsxFactory, markAsSynthetic);
|
|
49968
49934
|
if (file.localJsxFactory) {
|
|
49969
49935
|
return file.localJsxNamespace = ts.getFirstIdentifier(file.localJsxFactory).escapedText;
|
|
49970
49936
|
}
|
|
@@ -51623,7 +51589,6 @@ var ts;
|
|
|
51623
51589
|
return valueSymbol;
|
|
51624
51590
|
}
|
|
51625
51591
|
var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName);
|
|
51626
|
-
ts.Debug.assert(valueSymbol.declarations || typeSymbol.declarations);
|
|
51627
51592
|
result.declarations = ts.deduplicate(ts.concatenate(valueSymbol.declarations, typeSymbol.declarations), ts.equateValues);
|
|
51628
51593
|
result.parent = valueSymbol.parent || typeSymbol.parent;
|
|
51629
51594
|
if (valueSymbol.valueDeclaration)
|
|
@@ -53676,7 +53641,6 @@ var ts;
|
|
|
53676
53641
|
var objectFlags = ts.getObjectFlags(type);
|
|
53677
53642
|
if (objectFlags & 4 /* ObjectFlags.Reference */) {
|
|
53678
53643
|
ts.Debug.assert(!!(type.flags & 524288 /* TypeFlags.Object */));
|
|
53679
|
-
ts.Debug.type(type);
|
|
53680
53644
|
return type.node ? visitAndTransformType(type, typeReferenceToTypeNode) : typeReferenceToTypeNode(type);
|
|
53681
53645
|
}
|
|
53682
53646
|
if (type.flags & 262144 /* TypeFlags.TypeParameter */ || objectFlags & 3 /* ObjectFlags.ClassOrInterface */) {
|
|
@@ -55135,7 +55099,7 @@ var ts;
|
|
|
55135
55099
|
}
|
|
55136
55100
|
var hadError = false;
|
|
55137
55101
|
var file = ts.getSourceFileOfNode(existing);
|
|
55138
|
-
var transformed = ts.visitNode(existing, visitExistingNodeTreeSymbols
|
|
55102
|
+
var transformed = ts.visitNode(existing, visitExistingNodeTreeSymbols);
|
|
55139
55103
|
if (hadError) {
|
|
55140
55104
|
return undefined;
|
|
55141
55105
|
}
|
|
@@ -55166,7 +55130,7 @@ var ts;
|
|
|
55166
55130
|
var typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode(node), name.escapedText);
|
|
55167
55131
|
var overrideTypeNode = typeViaParent && t.typeExpression && getTypeFromTypeNode(t.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context) : undefined;
|
|
55168
55132
|
return ts.factory.createPropertySignature(
|
|
55169
|
-
/*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
|
|
55133
|
+
/*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 */));
|
|
55170
55134
|
}));
|
|
55171
55135
|
}
|
|
55172
55136
|
if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "") {
|
|
@@ -55177,18 +55141,18 @@ var ts;
|
|
|
55177
55141
|
/*modifiers*/ undefined, [ts.factory.createParameterDeclaration(
|
|
55178
55142
|
/*modifiers*/ undefined,
|
|
55179
55143
|
/*dotdotdotToken*/ undefined, "x",
|
|
55180
|
-
/*questionToken*/ undefined, ts.visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols
|
|
55144
|
+
/*questionToken*/ undefined, ts.visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols))], ts.visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols))]);
|
|
55181
55145
|
}
|
|
55182
55146
|
if (ts.isJSDocFunctionType(node)) {
|
|
55183
55147
|
if (ts.isJSDocConstructSignature(node)) {
|
|
55184
55148
|
var newTypeNode_1;
|
|
55185
55149
|
return ts.factory.createConstructorTypeNode(
|
|
55186
|
-
/*modifiers*/ undefined, ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols
|
|
55150
|
+
/*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(
|
|
55187
55151
|
/*modifiers*/ undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols),
|
|
55188
55152
|
/*initializer*/ undefined); }), ts.visitNode(newTypeNode_1 || node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */));
|
|
55189
55153
|
}
|
|
55190
55154
|
else {
|
|
55191
|
-
return ts.factory.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols
|
|
55155
|
+
return ts.factory.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.map(node.parameters, function (p, i) { return ts.factory.createParameterDeclaration(
|
|
55192
55156
|
/*modifiers*/ undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols),
|
|
55193
55157
|
/*initializer*/ undefined); }), ts.visitNode(node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */));
|
|
55194
55158
|
}
|
|
@@ -55514,6 +55478,7 @@ var ts;
|
|
|
55514
55478
|
&& symbol.escapedName !== "export=" /* InternalSymbolName.ExportEquals */
|
|
55515
55479
|
&& !(symbol.flags & 4194304 /* SymbolFlags.Prototype */)
|
|
55516
55480
|
&& !(symbol.flags & 32 /* SymbolFlags.Class */)
|
|
55481
|
+
&& !(symbol.flags & 8192 /* SymbolFlags.Method */)
|
|
55517
55482
|
&& !isConstMergedWithNSPrintableAsSignatureMerge) {
|
|
55518
55483
|
if (propertyAsAlias) {
|
|
55519
55484
|
var createdExport = serializeMaybeAliasAssignment(symbol);
|
|
@@ -55643,7 +55608,7 @@ var ts;
|
|
|
55643
55608
|
}
|
|
55644
55609
|
}
|
|
55645
55610
|
function includePrivateSymbol(symbol) {
|
|
55646
|
-
if (ts.some(symbol.declarations, ts.
|
|
55611
|
+
if (ts.some(symbol.declarations, ts.isParameterDeclaration))
|
|
55647
55612
|
return;
|
|
55648
55613
|
ts.Debug.assertIsDefined(deferredPrivatesStack[deferredPrivatesStack.length - 1]);
|
|
55649
55614
|
getUnusedName(ts.unescapeLeadingUnderscores(symbol.escapedName), symbol); // Call to cache unique name for symbol
|
|
@@ -56030,7 +55995,7 @@ var ts;
|
|
|
56030
55995
|
case 268 /* SyntaxKind.ImportEqualsDeclaration */:
|
|
56031
55996
|
// This _specifically_ only exists to handle json declarations - where we make aliases, but since
|
|
56032
55997
|
// we emit no declarations for the json document, must not refer to it in the declarations
|
|
56033
|
-
if (target.escapedName === "export=" /* InternalSymbolName.ExportEquals */ && ts.some(target.declarations,
|
|
55998
|
+
if (target.escapedName === "export=" /* InternalSymbolName.ExportEquals */ && ts.some(target.declarations, ts.isJsonSourceFile)) {
|
|
56034
55999
|
serializeMaybeAliasAssignment(symbol);
|
|
56035
56000
|
break;
|
|
56036
56001
|
}
|
|
@@ -57195,7 +57160,6 @@ var ts;
|
|
|
57195
57160
|
return container;
|
|
57196
57161
|
}
|
|
57197
57162
|
}
|
|
57198
|
-
;
|
|
57199
57163
|
}
|
|
57200
57164
|
/** Create a synthetic property access flow node after the last statement of the file */
|
|
57201
57165
|
function getFlowTypeFromCommonJSExport(symbol) {
|
|
@@ -60325,7 +60289,7 @@ var ts;
|
|
|
60325
60289
|
var isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp);
|
|
60326
60290
|
// If the symbols are instances of one another with identical types - consider the symbols
|
|
60327
60291
|
// equivalent and just use the first one, which thus allows us to avoid eliding private
|
|
60328
|
-
// members when intersecting a (this-)instantiations of a class with
|
|
60292
|
+
// members when intersecting a (this-)instantiations of a class with its raw base or another instance
|
|
60329
60293
|
if (isInstantiation && compareProperties(singleProp, prop, function (a, b) { return a === b ? -1 /* Ternary.True */ : 0 /* Ternary.False */; }) === -1 /* Ternary.True */) {
|
|
60330
60294
|
// If we merged instantiations of a generic type, we replicate the symbol parent resetting behavior we used
|
|
60331
60295
|
// to do when we recorded multiple distinct symbols so that we still get, eg, `Array<T>.length` printed
|
|
@@ -60373,7 +60337,11 @@ var ts;
|
|
|
60373
60337
|
}
|
|
60374
60338
|
}
|
|
60375
60339
|
}
|
|
60376
|
-
if (!singleProp ||
|
|
60340
|
+
if (!singleProp ||
|
|
60341
|
+
isUnion &&
|
|
60342
|
+
(propSet || checkFlags & 48 /* CheckFlags.Partial */) &&
|
|
60343
|
+
checkFlags & (1024 /* CheckFlags.ContainsPrivate */ | 512 /* CheckFlags.ContainsProtected */) &&
|
|
60344
|
+
!(propSet && getCommonDeclarationsOfSymbols(ts.arrayFrom(propSet.values())))) {
|
|
60377
60345
|
// No property was found, or, in a union, a property has a private or protected declaration in one
|
|
60378
60346
|
// constituent, but is missing or has a different declaration in another constituent.
|
|
60379
60347
|
return undefined;
|
|
@@ -60475,6 +60443,33 @@ var ts;
|
|
|
60475
60443
|
}
|
|
60476
60444
|
return property;
|
|
60477
60445
|
}
|
|
60446
|
+
function getCommonDeclarationsOfSymbols(symbols) {
|
|
60447
|
+
var commonDeclarations;
|
|
60448
|
+
var _loop_14 = function (symbol) {
|
|
60449
|
+
if (!symbol.declarations) {
|
|
60450
|
+
return { value: undefined };
|
|
60451
|
+
}
|
|
60452
|
+
if (!commonDeclarations) {
|
|
60453
|
+
commonDeclarations = new ts.Set(symbol.declarations);
|
|
60454
|
+
return "continue";
|
|
60455
|
+
}
|
|
60456
|
+
commonDeclarations.forEach(function (declaration) {
|
|
60457
|
+
if (!ts.contains(symbol.declarations, declaration)) {
|
|
60458
|
+
commonDeclarations.delete(declaration);
|
|
60459
|
+
}
|
|
60460
|
+
});
|
|
60461
|
+
if (commonDeclarations.size === 0) {
|
|
60462
|
+
return { value: undefined };
|
|
60463
|
+
}
|
|
60464
|
+
};
|
|
60465
|
+
for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) {
|
|
60466
|
+
var symbol = symbols_3[_i];
|
|
60467
|
+
var state_4 = _loop_14(symbol);
|
|
60468
|
+
if (typeof state_4 === "object")
|
|
60469
|
+
return state_4.value;
|
|
60470
|
+
}
|
|
60471
|
+
return commonDeclarations;
|
|
60472
|
+
}
|
|
60478
60473
|
function getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment) {
|
|
60479
60474
|
var property = getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
60480
60475
|
// We need to filter out partial properties in union types
|
|
@@ -61189,7 +61184,7 @@ var ts;
|
|
|
61189
61184
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
61190
61185
|
if (indexSymbol.declarations) {
|
|
61191
61186
|
var indexInfos_4 = [];
|
|
61192
|
-
var
|
|
61187
|
+
var _loop_15 = function (declaration) {
|
|
61193
61188
|
if (declaration.parameters.length === 1) {
|
|
61194
61189
|
var parameter = declaration.parameters[0];
|
|
61195
61190
|
if (parameter.type) {
|
|
@@ -61203,7 +61198,7 @@ var ts;
|
|
|
61203
61198
|
};
|
|
61204
61199
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
61205
61200
|
var declaration = _a[_i];
|
|
61206
|
-
|
|
61201
|
+
_loop_15(declaration);
|
|
61207
61202
|
}
|
|
61208
61203
|
return indexInfos_4;
|
|
61209
61204
|
}
|
|
@@ -61220,7 +61215,7 @@ var ts;
|
|
|
61220
61215
|
var _a;
|
|
61221
61216
|
var inferences;
|
|
61222
61217
|
if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
|
|
61223
|
-
var
|
|
61218
|
+
var _loop_16 = function (declaration) {
|
|
61224
61219
|
if (declaration.parent.kind === 192 /* SyntaxKind.InferType */) {
|
|
61225
61220
|
// When an 'infer T' declaration is immediately contained in a type reference node
|
|
61226
61221
|
// (such as 'Foo<infer T>'), T's constraint is inferred from the constraint of the
|
|
@@ -61284,7 +61279,7 @@ var ts;
|
|
|
61284
61279
|
};
|
|
61285
61280
|
for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
|
|
61286
61281
|
var declaration = _b[_i];
|
|
61287
|
-
|
|
61282
|
+
_loop_16(declaration);
|
|
61288
61283
|
}
|
|
61289
61284
|
}
|
|
61290
61285
|
return inferences && getIntersectionType(inferences);
|
|
@@ -61941,6 +61936,13 @@ var ts;
|
|
|
61941
61936
|
function getGlobalBigIntType() {
|
|
61942
61937
|
return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", /*arity*/ 0, /*reportErrors*/ false))) || emptyObjectType;
|
|
61943
61938
|
}
|
|
61939
|
+
function getGlobalNaNSymbol() {
|
|
61940
|
+
return (deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol("NaN", /*reportErrors*/ false)));
|
|
61941
|
+
}
|
|
61942
|
+
function getGlobalRecordSymbol() {
|
|
61943
|
+
deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol("Record", /*arity*/ 2, /*reportErrors*/ true) || unknownSymbol);
|
|
61944
|
+
return deferredGlobalRecordSymbol === unknownSymbol ? undefined : deferredGlobalRecordSymbol;
|
|
61945
|
+
}
|
|
61944
61946
|
/**
|
|
61945
61947
|
* Instantiates a global type that is generic with some element type, and returns that instantiation.
|
|
61946
61948
|
*/
|
|
@@ -62177,7 +62179,7 @@ var ts;
|
|
|
62177
62179
|
var lastRequiredIndex = -1;
|
|
62178
62180
|
var firstRestIndex = -1;
|
|
62179
62181
|
var lastOptionalOrRestIndex = -1;
|
|
62180
|
-
var
|
|
62182
|
+
var _loop_17 = function (i) {
|
|
62181
62183
|
var type = elementTypes[i];
|
|
62182
62184
|
var flags = target.elementFlags[i];
|
|
62183
62185
|
if (flags & 8 /* ElementFlags.Variadic */) {
|
|
@@ -62207,9 +62209,9 @@ var ts;
|
|
|
62207
62209
|
}
|
|
62208
62210
|
};
|
|
62209
62211
|
for (var i = 0; i < elementTypes.length; i++) {
|
|
62210
|
-
var
|
|
62211
|
-
if (typeof
|
|
62212
|
-
return
|
|
62212
|
+
var state_5 = _loop_17(i);
|
|
62213
|
+
if (typeof state_5 === "object")
|
|
62214
|
+
return state_5.value;
|
|
62213
62215
|
}
|
|
62214
62216
|
// Turn optional elements preceding the last required element into required elements
|
|
62215
62217
|
for (var i = 0; i < lastRequiredIndex; i++) {
|
|
@@ -62237,7 +62239,7 @@ var ts;
|
|
|
62237
62239
|
if (flags & (2 /* ElementFlags.Optional */ | 4 /* ElementFlags.Rest */)) {
|
|
62238
62240
|
lastOptionalOrRestIndex = expandedFlags.length;
|
|
62239
62241
|
}
|
|
62240
|
-
expandedTypes.push(type);
|
|
62242
|
+
expandedTypes.push(flags & 2 /* ElementFlags.Optional */ ? addOptionality(type, /*isProperty*/ true) : type);
|
|
62241
62243
|
expandedFlags.push(flags);
|
|
62242
62244
|
if (expandedDeclarations && declaration) {
|
|
62243
62245
|
expandedDeclarations.push(declaration);
|
|
@@ -62403,7 +62405,7 @@ var ts;
|
|
|
62403
62405
|
var templates = ts.filter(types, isPatternLiteralType);
|
|
62404
62406
|
if (templates.length) {
|
|
62405
62407
|
var i = types.length;
|
|
62406
|
-
var
|
|
62408
|
+
var _loop_18 = function () {
|
|
62407
62409
|
i--;
|
|
62408
62410
|
var t = types[i];
|
|
62409
62411
|
if (t.flags & 128 /* TypeFlags.StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
@@ -62411,7 +62413,7 @@ var ts;
|
|
|
62411
62413
|
}
|
|
62412
62414
|
};
|
|
62413
62415
|
while (i > 0) {
|
|
62414
|
-
|
|
62416
|
+
_loop_18();
|
|
62415
62417
|
}
|
|
62416
62418
|
}
|
|
62417
62419
|
}
|
|
@@ -62488,14 +62490,14 @@ var ts;
|
|
|
62488
62490
|
var namedUnions = [];
|
|
62489
62491
|
addNamedUnions(namedUnions, types);
|
|
62490
62492
|
var reducedTypes = [];
|
|
62491
|
-
var
|
|
62493
|
+
var _loop_19 = function (t) {
|
|
62492
62494
|
if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
|
|
62493
62495
|
reducedTypes.push(t);
|
|
62494
62496
|
}
|
|
62495
62497
|
};
|
|
62496
62498
|
for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
|
|
62497
62499
|
var t = typeSet_1[_i];
|
|
62498
|
-
|
|
62500
|
+
_loop_19(t);
|
|
62499
62501
|
}
|
|
62500
62502
|
if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
|
|
62501
62503
|
return namedUnions[0];
|
|
@@ -63725,7 +63727,7 @@ var ts;
|
|
|
63725
63727
|
var result;
|
|
63726
63728
|
var extraTypes;
|
|
63727
63729
|
var tailCount = 0;
|
|
63728
|
-
var
|
|
63730
|
+
var _loop_20 = function () {
|
|
63729
63731
|
if (tailCount === 1000) {
|
|
63730
63732
|
error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
63731
63733
|
result = errorType;
|
|
@@ -63846,10 +63848,10 @@ var ts;
|
|
|
63846
63848
|
// another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
|
|
63847
63849
|
// cases we increment the tail recursion counter and stop after 1000 iterations.
|
|
63848
63850
|
while (true) {
|
|
63849
|
-
var
|
|
63850
|
-
if (typeof
|
|
63851
|
-
return
|
|
63852
|
-
if (
|
|
63851
|
+
var state_6 = _loop_20();
|
|
63852
|
+
if (typeof state_6 === "object")
|
|
63853
|
+
return state_6.value;
|
|
63854
|
+
if (state_6 === "break")
|
|
63853
63855
|
break;
|
|
63854
63856
|
}
|
|
63855
63857
|
return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
|
|
@@ -66464,7 +66466,7 @@ var ts;
|
|
|
66464
66466
|
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
|
66465
66467
|
checkTypes = reducedTarget.flags & 1048576 /* TypeFlags.Union */ ? reducedTarget.types : [reducedTarget];
|
|
66466
66468
|
}
|
|
66467
|
-
var
|
|
66469
|
+
var _loop_21 = function (prop) {
|
|
66468
66470
|
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
|
66469
66471
|
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
|
66470
66472
|
if (reportErrors) {
|
|
@@ -66527,9 +66529,9 @@ var ts;
|
|
|
66527
66529
|
};
|
|
66528
66530
|
for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
|
|
66529
66531
|
var prop = _b[_i];
|
|
66530
|
-
var
|
|
66531
|
-
if (typeof
|
|
66532
|
-
return
|
|
66532
|
+
var state_7 = _loop_21(prop);
|
|
66533
|
+
if (typeof state_7 === "object")
|
|
66534
|
+
return state_7.value;
|
|
66533
66535
|
}
|
|
66534
66536
|
return false;
|
|
66535
66537
|
}
|
|
@@ -67520,11 +67522,11 @@ var ts;
|
|
|
67520
67522
|
// constituents of 'target'. If any combination does not have a match then 'source' is not relatable.
|
|
67521
67523
|
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
|
67522
67524
|
var matchingTypes = [];
|
|
67523
|
-
var
|
|
67525
|
+
var _loop_22 = function (combination) {
|
|
67524
67526
|
var hasMatch = false;
|
|
67525
67527
|
outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
|
|
67526
67528
|
var type = _d[_c];
|
|
67527
|
-
var
|
|
67529
|
+
var _loop_23 = function (i) {
|
|
67528
67530
|
var sourceProperty = sourcePropertiesFiltered[i];
|
|
67529
67531
|
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
|
67530
67532
|
if (!targetProperty)
|
|
@@ -67540,8 +67542,8 @@ var ts;
|
|
|
67540
67542
|
}
|
|
67541
67543
|
};
|
|
67542
67544
|
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
|
67543
|
-
var
|
|
67544
|
-
switch (
|
|
67545
|
+
var state_9 = _loop_23(i);
|
|
67546
|
+
switch (state_9) {
|
|
67545
67547
|
case "continue-outer": continue outer;
|
|
67546
67548
|
}
|
|
67547
67549
|
}
|
|
@@ -67554,9 +67556,9 @@ var ts;
|
|
|
67554
67556
|
};
|
|
67555
67557
|
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
|
67556
67558
|
var combination = discriminantCombinations_1[_a];
|
|
67557
|
-
var
|
|
67558
|
-
if (typeof
|
|
67559
|
-
return
|
|
67559
|
+
var state_8 = _loop_22(combination);
|
|
67560
|
+
if (typeof state_8 === "object")
|
|
67561
|
+
return state_8.value;
|
|
67560
67562
|
}
|
|
67561
67563
|
// Compare the remaining non-discriminant properties of each match.
|
|
67562
67564
|
var result = -1 /* Ternary.True */;
|
|
@@ -68261,7 +68263,7 @@ var ts;
|
|
|
68261
68263
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* tracing.Phase.CheckTypes */, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
68262
68264
|
links.variances = ts.emptyArray;
|
|
68263
68265
|
var variances = [];
|
|
68264
|
-
var
|
|
68266
|
+
var _loop_24 = function (tp) {
|
|
68265
68267
|
var modifiers = getVarianceModifiers(tp);
|
|
68266
68268
|
var variance = modifiers & 65536 /* ModifierFlags.Out */ ?
|
|
68267
68269
|
modifiers & 32768 /* ModifierFlags.In */ ? 0 /* VarianceFlags.Invariant */ : 1 /* VarianceFlags.Covariant */ :
|
|
@@ -68299,7 +68301,7 @@ var ts;
|
|
|
68299
68301
|
};
|
|
68300
68302
|
for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
|
|
68301
68303
|
var tp = typeParameters_2[_i];
|
|
68302
|
-
|
|
68304
|
+
_loop_24(tp);
|
|
68303
68305
|
}
|
|
68304
68306
|
links.variances = variances;
|
|
68305
68307
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
|
|
@@ -68891,7 +68893,8 @@ var ts;
|
|
|
68891
68893
|
function getOptionalType(type, isProperty) {
|
|
68892
68894
|
if (isProperty === void 0) { isProperty = false; }
|
|
68893
68895
|
ts.Debug.assert(strictNullChecks);
|
|
68894
|
-
|
|
68896
|
+
var missingOrUndefined = isProperty ? missingType : undefinedType;
|
|
68897
|
+
return type.flags & 32768 /* TypeFlags.Undefined */ || type.flags & 1048576 /* TypeFlags.Union */ && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
|
|
68895
68898
|
}
|
|
68896
68899
|
function getGlobalNonNullableTypeInstantiation(type) {
|
|
68897
68900
|
if (!deferredGlobalNonNullableTypeAlias) {
|
|
@@ -70256,7 +70259,7 @@ var ts;
|
|
|
70256
70259
|
// upon instantiation, would collapse all the placeholders to just 'string', and an assignment check might
|
|
70257
70260
|
// succeed. That would be a pointless and confusing outcome.
|
|
70258
70261
|
if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
|
|
70259
|
-
var
|
|
70262
|
+
var _loop_25 = function (i) {
|
|
70260
70263
|
var source_1 = matches ? matches[i] : neverType;
|
|
70261
70264
|
var target_3 = types[i];
|
|
70262
70265
|
// If we are inferring from a string literal type to a type variable whose constraint includes one of the
|
|
@@ -70306,7 +70309,7 @@ var ts;
|
|
|
70306
70309
|
inferFromTypes(source_1, target_3);
|
|
70307
70310
|
};
|
|
70308
70311
|
for (var i = 0; i < types.length; i++) {
|
|
70309
|
-
|
|
70312
|
+
_loop_25(i);
|
|
70310
70313
|
}
|
|
70311
70314
|
}
|
|
70312
70315
|
}
|
|
@@ -70770,7 +70773,7 @@ var ts;
|
|
|
70770
70773
|
return name;
|
|
70771
70774
|
}
|
|
70772
70775
|
}
|
|
70773
|
-
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
70776
|
+
if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
|
|
70774
70777
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
70775
70778
|
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
70776
70779
|
}
|
|
@@ -70830,7 +70833,7 @@ var ts;
|
|
|
70830
70833
|
function mapTypesByKeyProperty(types, name) {
|
|
70831
70834
|
var map = new ts.Map();
|
|
70832
70835
|
var count = 0;
|
|
70833
|
-
var
|
|
70836
|
+
var _loop_26 = function (type) {
|
|
70834
70837
|
if (type.flags & (524288 /* TypeFlags.Object */ | 2097152 /* TypeFlags.Intersection */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */)) {
|
|
70835
70838
|
var discriminant = getTypeOfPropertyOfType(type, name);
|
|
70836
70839
|
if (discriminant) {
|
|
@@ -70856,9 +70859,9 @@ var ts;
|
|
|
70856
70859
|
};
|
|
70857
70860
|
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
70858
70861
|
var type = types_15[_i];
|
|
70859
|
-
var
|
|
70860
|
-
if (typeof
|
|
70861
|
-
return
|
|
70862
|
+
var state_10 = _loop_26(type);
|
|
70863
|
+
if (typeof state_10 === "object")
|
|
70864
|
+
return state_10.value;
|
|
70862
70865
|
}
|
|
70863
70866
|
return count >= 10 && count * 2 >= types.length ? map : undefined;
|
|
70864
70867
|
}
|
|
@@ -72257,18 +72260,26 @@ var ts;
|
|
|
72257
72260
|
}
|
|
72258
72261
|
function isTypePresencePossible(type, propName, assumeTrue) {
|
|
72259
72262
|
var prop = getPropertyOfType(type, propName);
|
|
72260
|
-
|
|
72261
|
-
|
|
72262
|
-
|
|
72263
|
-
|
|
72264
|
-
|
|
72265
|
-
|
|
72266
|
-
|
|
72267
|
-
|
|
72268
|
-
|
|
72269
|
-
|
|
72263
|
+
return prop ?
|
|
72264
|
+
!!(prop.flags & 16777216 /* SymbolFlags.Optional */) || assumeTrue :
|
|
72265
|
+
!!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
|
|
72266
|
+
}
|
|
72267
|
+
function narrowByInKeyword(type, nameType, assumeTrue) {
|
|
72268
|
+
var name = getPropertyNameFromType(nameType);
|
|
72269
|
+
var isKnownProperty = someType(type, function (t) { return isTypePresencePossible(t, name, /*assumeTrue*/ true); });
|
|
72270
|
+
if (isKnownProperty) {
|
|
72271
|
+
// If the check is for a known property (i.e. a property declared in some constituent of
|
|
72272
|
+
// the target type), we filter the target type by presence of absence of the property.
|
|
72270
72273
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
72271
72274
|
}
|
|
72275
|
+
if (assumeTrue) {
|
|
72276
|
+
// If the check is for an unknown property, we intersect the target type with `Record<X, unknown>`,
|
|
72277
|
+
// where X is the name of the property.
|
|
72278
|
+
var recordSymbol = getGlobalRecordSymbol();
|
|
72279
|
+
if (recordSymbol) {
|
|
72280
|
+
return getIntersectionType([type, getTypeAliasInstantiation(recordSymbol, [nameType, unknownType])]);
|
|
72281
|
+
}
|
|
72282
|
+
}
|
|
72272
72283
|
return type;
|
|
72273
72284
|
}
|
|
72274
72285
|
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
|
|
@@ -72327,15 +72338,14 @@ var ts;
|
|
|
72327
72338
|
return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
|
|
72328
72339
|
}
|
|
72329
72340
|
var target = getReferenceCandidate(expr.right);
|
|
72330
|
-
var leftType =
|
|
72331
|
-
if (leftType.flags &
|
|
72332
|
-
var name = ts.escapeLeadingUnderscores(leftType.value);
|
|
72341
|
+
var leftType = getTypeOfExpression(expr.left);
|
|
72342
|
+
if (leftType.flags & 8576 /* TypeFlags.StringOrNumberLiteralOrUnique */) {
|
|
72333
72343
|
if (containsMissingType(type) && ts.isAccessExpression(reference) && isMatchingReference(reference.expression, target) &&
|
|
72334
|
-
getAccessedPropertyName(reference) ===
|
|
72344
|
+
getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
|
|
72335
72345
|
return getTypeWithFacts(type, assumeTrue ? 524288 /* TypeFacts.NEUndefined */ : 65536 /* TypeFacts.EQUndefined */);
|
|
72336
72346
|
}
|
|
72337
72347
|
if (isMatchingReference(reference, target)) {
|
|
72338
|
-
return narrowByInKeyword(type,
|
|
72348
|
+
return narrowByInKeyword(type, leftType, assumeTrue);
|
|
72339
72349
|
}
|
|
72340
72350
|
}
|
|
72341
72351
|
break;
|
|
@@ -74597,7 +74607,7 @@ var ts;
|
|
|
74597
74607
|
return left === right || !left ? left
|
|
74598
74608
|
: compareTypeParametersIdentical(left.typeParameters, right.typeParameters) ? combineSignaturesOfIntersectionMembers(left, right)
|
|
74599
74609
|
: undefined;
|
|
74600
|
-
})
|
|
74610
|
+
})
|
|
74601
74611
|
: undefined;
|
|
74602
74612
|
}
|
|
74603
74613
|
function combineIntersectionThisParam(left, right, mapper) {
|
|
@@ -76505,7 +76515,6 @@ var ts;
|
|
|
76505
76515
|
}
|
|
76506
76516
|
return false;
|
|
76507
76517
|
}
|
|
76508
|
-
;
|
|
76509
76518
|
var suggestedMethod = ts.isAssignmentTarget(expr) ? "set" : "get";
|
|
76510
76519
|
if (!hasProp(suggestedMethod)) {
|
|
76511
76520
|
return undefined;
|
|
@@ -77307,7 +77316,7 @@ var ts;
|
|
|
77307
77316
|
if (spreadIndex >= 0) {
|
|
77308
77317
|
// Create synthetic arguments from spreads of tuple types.
|
|
77309
77318
|
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
|
77310
|
-
var
|
|
77319
|
+
var _loop_27 = function (i) {
|
|
77311
77320
|
var arg = args[i];
|
|
77312
77321
|
// We can call checkExpressionCached because spread expressions never have a contextual type.
|
|
77313
77322
|
var spreadType = arg.kind === 227 /* SyntaxKind.SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
@@ -77324,7 +77333,7 @@ var ts;
|
|
|
77324
77333
|
}
|
|
77325
77334
|
};
|
|
77326
77335
|
for (var i = spreadIndex; i < args.length; i++) {
|
|
77327
|
-
|
|
77336
|
+
_loop_27(i);
|
|
77328
77337
|
}
|
|
77329
77338
|
return effectiveArgs_1;
|
|
77330
77339
|
}
|
|
@@ -77653,7 +77662,7 @@ var ts;
|
|
|
77653
77662
|
var min_3 = Number.MAX_VALUE;
|
|
77654
77663
|
var minIndex = 0;
|
|
77655
77664
|
var i_1 = 0;
|
|
77656
|
-
var
|
|
77665
|
+
var _loop_28 = function (c) {
|
|
77657
77666
|
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)); };
|
|
77658
77667
|
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* CheckMode.Normal */, /*reportErrors*/ true, chain_2);
|
|
77659
77668
|
if (diags_2) {
|
|
@@ -77671,7 +77680,7 @@ var ts;
|
|
|
77671
77680
|
};
|
|
77672
77681
|
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
|
77673
77682
|
var c = candidatesForArgumentError_1[_a];
|
|
77674
|
-
|
|
77683
|
+
_loop_28(c);
|
|
77675
77684
|
}
|
|
77676
77685
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
77677
77686
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
@@ -77829,7 +77838,7 @@ var ts;
|
|
|
77829
77838
|
}
|
|
77830
77839
|
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
|
77831
77840
|
var parameters = [];
|
|
77832
|
-
var
|
|
77841
|
+
var _loop_29 = function (i) {
|
|
77833
77842
|
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
|
77834
77843
|
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
|
77835
77844
|
i < s.parameters.length ? s.parameters[i] : undefined; });
|
|
@@ -77837,7 +77846,7 @@ var ts;
|
|
|
77837
77846
|
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
|
77838
77847
|
};
|
|
77839
77848
|
for (var i = 0; i < maxNonRestParam; i++) {
|
|
77840
|
-
|
|
77849
|
+
_loop_29(i);
|
|
77841
77850
|
}
|
|
77842
77851
|
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
|
77843
77852
|
var flags = 0 /* SignatureFlags.None */;
|
|
@@ -80076,6 +80085,9 @@ var ts;
|
|
|
80076
80085
|
}
|
|
80077
80086
|
return booleanType;
|
|
80078
80087
|
}
|
|
80088
|
+
function hasEmptyObjectIntersection(type) {
|
|
80089
|
+
return someType(type, function (t) { return t === unknownEmptyObjectType || !!(t.flags & 2097152 /* TypeFlags.Intersection */) && ts.some(t.types, isEmptyAnonymousObjectType); });
|
|
80090
|
+
}
|
|
80079
80091
|
function checkInExpression(left, right, leftType, rightType) {
|
|
80080
80092
|
if (leftType === silentNeverType || rightType === silentNeverType) {
|
|
80081
80093
|
return silentNeverType;
|
|
@@ -80092,40 +80104,20 @@ var ts;
|
|
|
80092
80104
|
}
|
|
80093
80105
|
}
|
|
80094
80106
|
else {
|
|
80095
|
-
|
|
80096
|
-
|
|
80097
|
-
|
|
80098
|
-
|
|
80099
|
-
|
|
80100
|
-
|
|
80107
|
+
// The type of the lef operand must be assignable to string, number, or symbol.
|
|
80108
|
+
checkTypeAssignableTo(checkNonNullType(leftType, left), stringNumberSymbolType, left);
|
|
80109
|
+
}
|
|
80110
|
+
// The type of the right operand must be assignable to 'object'.
|
|
80111
|
+
if (checkTypeAssignableTo(checkNonNullType(rightType, right), nonPrimitiveType, right)) {
|
|
80112
|
+
// The {} type is assignable to the object type, yet {} might represent a primitive type. Here we
|
|
80113
|
+
// detect and error on {} that results from narrowing the unknown type, as well as intersections
|
|
80114
|
+
// that include {} (we know that the other types in such intersections are assignable to object
|
|
80115
|
+
// since we already checked for that).
|
|
80116
|
+
if (hasEmptyObjectIntersection(rightType)) {
|
|
80117
|
+
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));
|
|
80101
80118
|
}
|
|
80102
80119
|
}
|
|
80103
|
-
rightType = checkNonNullType(rightType, right);
|
|
80104
|
-
// TypeScript 1.0 spec (April 2014): 4.15.5
|
|
80105
|
-
// The in operator requires the right operand to be
|
|
80106
|
-
//
|
|
80107
|
-
// 1. assignable to the non-primitive type,
|
|
80108
|
-
// 2. an unconstrained type parameter,
|
|
80109
|
-
// 3. a union or intersection including one or more type parameters, whose constituents are all assignable to the
|
|
80110
|
-
// the non-primitive type, or are unconstrainted type parameters, or have constraints assignable to the
|
|
80111
|
-
// non-primitive type, or
|
|
80112
|
-
// 4. a type parameter whose constraint is
|
|
80113
|
-
// i. an object type,
|
|
80114
|
-
// ii. the non-primitive type, or
|
|
80115
|
-
// iii. a union or intersection with at least one constituent assignable to an object or non-primitive type.
|
|
80116
|
-
//
|
|
80117
|
-
// The divergent behavior for type parameters and unions containing type parameters is a workaround for type
|
|
80118
|
-
// parameters not being narrowable. If the right operand is a concrete type, we can error if there is any chance
|
|
80119
|
-
// it is a primitive. But if the operand is a type parameter, it cannot be narrowed, so we don't issue an error
|
|
80120
|
-
// unless *all* instantiations would result in an error.
|
|
80121
|
-
//
|
|
80122
80120
|
// The result is always of the Boolean primitive type.
|
|
80123
|
-
var rightTypeConstraint = getConstraintOfType(rightType);
|
|
80124
|
-
if (!allTypesAssignableToKind(rightType, 67108864 /* TypeFlags.NonPrimitive */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */) ||
|
|
80125
|
-
rightTypeConstraint && (isTypeAssignableToKind(rightType, 3145728 /* TypeFlags.UnionOrIntersection */) && !allTypesAssignableToKind(rightTypeConstraint, 67108864 /* TypeFlags.NonPrimitive */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */) ||
|
|
80126
|
-
!maybeTypeOfKind(rightTypeConstraint, 67108864 /* TypeFlags.NonPrimitive */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */ | 524288 /* TypeFlags.Object */))) {
|
|
80127
|
-
error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_not_be_a_primitive);
|
|
80128
|
-
}
|
|
80129
80121
|
return booleanType;
|
|
80130
80122
|
}
|
|
80131
80123
|
function checkObjectLiteralAssignment(node, sourceType, rightIsThis) {
|
|
@@ -80636,6 +80628,7 @@ var ts;
|
|
|
80636
80628
|
var eqType = operator === 34 /* SyntaxKind.EqualsEqualsToken */ || operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */;
|
|
80637
80629
|
error(errorNode, ts.Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
|
|
80638
80630
|
}
|
|
80631
|
+
checkNaNEquality(errorNode, operator, left, right);
|
|
80639
80632
|
reportOperatorErrorUnless(function (left, right) { return isTypeEqualityComparableTo(left, right) || isTypeEqualityComparableTo(right, left); });
|
|
80640
80633
|
return booleanType;
|
|
80641
80634
|
case 102 /* SyntaxKind.InstanceOfKeyword */:
|
|
@@ -80841,6 +80834,26 @@ var ts;
|
|
|
80841
80834
|
return undefined;
|
|
80842
80835
|
}
|
|
80843
80836
|
}
|
|
80837
|
+
function checkNaNEquality(errorNode, operator, left, right) {
|
|
80838
|
+
var isLeftNaN = isGlobalNaN(ts.skipParentheses(left));
|
|
80839
|
+
var isRightNaN = isGlobalNaN(ts.skipParentheses(right));
|
|
80840
|
+
if (isLeftNaN || isRightNaN) {
|
|
80841
|
+
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 */));
|
|
80842
|
+
if (isLeftNaN && isRightNaN)
|
|
80843
|
+
return;
|
|
80844
|
+
var operatorString = operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */ || operator === 35 /* SyntaxKind.ExclamationEqualsToken */ ? ts.tokenToString(53 /* SyntaxKind.ExclamationToken */) : "";
|
|
80845
|
+
var location = isLeftNaN ? right : left;
|
|
80846
|
+
var expression = ts.skipParentheses(location);
|
|
80847
|
+
ts.addRelatedInfo(err, ts.createDiagnosticForNode(location, ts.Diagnostics.Did_you_mean_0, "".concat(operatorString, "Number.isNaN(").concat(ts.isEntityNameExpression(expression) ? ts.entityNameToString(expression) : "...", ")")));
|
|
80848
|
+
}
|
|
80849
|
+
}
|
|
80850
|
+
function isGlobalNaN(expr) {
|
|
80851
|
+
if (ts.isIdentifier(expr) && expr.escapedText === "NaN") {
|
|
80852
|
+
var globalNaNSymbol = getGlobalNaNSymbol();
|
|
80853
|
+
return !!globalNaNSymbol && globalNaNSymbol === getResolvedSymbol(expr);
|
|
80854
|
+
}
|
|
80855
|
+
return false;
|
|
80856
|
+
}
|
|
80844
80857
|
}
|
|
80845
80858
|
function getBaseTypesIfUnrelated(leftType, rightType, isRelated) {
|
|
80846
80859
|
var effectiveLeft = leftType;
|
|
@@ -81878,7 +81891,7 @@ var ts;
|
|
|
81878
81891
|
var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
|
|
81879
81892
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
81880
81893
|
var indexSignatureMap_1 = new ts.Map();
|
|
81881
|
-
var
|
|
81894
|
+
var _loop_30 = function (declaration) {
|
|
81882
81895
|
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
|
81883
81896
|
forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
|
|
81884
81897
|
var entry = indexSignatureMap_1.get(getTypeId(type));
|
|
@@ -81893,7 +81906,7 @@ var ts;
|
|
|
81893
81906
|
};
|
|
81894
81907
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
81895
81908
|
var declaration = _a[_i];
|
|
81896
|
-
|
|
81909
|
+
_loop_30(declaration);
|
|
81897
81910
|
}
|
|
81898
81911
|
indexSignatureMap_1.forEach(function (entry) {
|
|
81899
81912
|
if (entry.declarations.length > 1) {
|
|
@@ -85493,7 +85506,7 @@ var ts;
|
|
|
85493
85506
|
var propDeclaration = declaration && declaration.kind === 223 /* SyntaxKind.BinaryExpression */ ||
|
|
85494
85507
|
name && name.kind === 164 /* SyntaxKind.ComputedPropertyName */ ? declaration : undefined;
|
|
85495
85508
|
var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
|
|
85496
|
-
var
|
|
85509
|
+
var _loop_31 = function (info) {
|
|
85497
85510
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
85498
85511
|
// We check only when (a) the property is declared in the containing type, or (b) the applicable index signature is declared
|
|
85499
85512
|
// in the containing type, or (c) the containing type is an interface and no base interface contains both the property and
|
|
@@ -85510,7 +85523,7 @@ var ts;
|
|
|
85510
85523
|
};
|
|
85511
85524
|
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
85512
85525
|
var info = indexInfos_9[_i];
|
|
85513
|
-
|
|
85526
|
+
_loop_31(info);
|
|
85514
85527
|
}
|
|
85515
85528
|
}
|
|
85516
85529
|
function checkIndexConstraintForIndexSignature(type, checkInfo) {
|
|
@@ -85518,7 +85531,7 @@ var ts;
|
|
|
85518
85531
|
var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
|
|
85519
85532
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* ObjectFlags.Interface */ ? ts.getDeclarationOfKind(type.symbol, 261 /* SyntaxKind.InterfaceDeclaration */) : undefined;
|
|
85520
85533
|
var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
|
|
85521
|
-
var
|
|
85534
|
+
var _loop_32 = function (info) {
|
|
85522
85535
|
if (info === checkInfo)
|
|
85523
85536
|
return "continue";
|
|
85524
85537
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
@@ -85533,7 +85546,7 @@ var ts;
|
|
|
85533
85546
|
};
|
|
85534
85547
|
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
85535
85548
|
var info = indexInfos_10[_i];
|
|
85536
|
-
|
|
85549
|
+
_loop_32(info);
|
|
85537
85550
|
}
|
|
85538
85551
|
}
|
|
85539
85552
|
function checkTypeNameIsReserved(name, message) {
|
|
@@ -85853,7 +85866,7 @@ var ts;
|
|
|
85853
85866
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
85854
85867
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
85855
85868
|
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
85856
|
-
var
|
|
85869
|
+
var _loop_33 = function (member) {
|
|
85857
85870
|
if (ts.hasAmbientModifier(member)) {
|
|
85858
85871
|
return "continue";
|
|
85859
85872
|
}
|
|
@@ -85870,7 +85883,7 @@ var ts;
|
|
|
85870
85883
|
};
|
|
85871
85884
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
85872
85885
|
var member = _a[_i];
|
|
85873
|
-
|
|
85886
|
+
_loop_33(member);
|
|
85874
85887
|
}
|
|
85875
85888
|
}
|
|
85876
85889
|
/**
|
|
@@ -85958,7 +85971,7 @@ var ts;
|
|
|
85958
85971
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
85959
85972
|
// iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
|
|
85960
85973
|
var issuedMemberError = false;
|
|
85961
|
-
var
|
|
85974
|
+
var _loop_34 = function (member) {
|
|
85962
85975
|
if (ts.isStatic(member)) {
|
|
85963
85976
|
return "continue";
|
|
85964
85977
|
}
|
|
@@ -85977,7 +85990,7 @@ var ts;
|
|
|
85977
85990
|
};
|
|
85978
85991
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
85979
85992
|
var member = _a[_i];
|
|
85980
|
-
|
|
85993
|
+
_loop_34(member);
|
|
85981
85994
|
}
|
|
85982
85995
|
if (!issuedMemberError) {
|
|
85983
85996
|
// check again with diagnostics to generate a less-specific error
|
|
@@ -86048,7 +86061,7 @@ var ts;
|
|
|
86048
86061
|
var _a, _b, _c, _d;
|
|
86049
86062
|
// NOTE: assignability is checked in checkClassDeclaration
|
|
86050
86063
|
var baseProperties = getPropertiesOfType(baseType);
|
|
86051
|
-
var
|
|
86064
|
+
var _loop_35 = function (baseProperty) {
|
|
86052
86065
|
var base = getTargetSymbol(baseProperty);
|
|
86053
86066
|
if (base.flags & 4194304 /* SymbolFlags.Prototype */) {
|
|
86054
86067
|
return "continue";
|
|
@@ -86158,8 +86171,8 @@ var ts;
|
|
|
86158
86171
|
};
|
|
86159
86172
|
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
86160
86173
|
var baseProperty = baseProperties_1[_i];
|
|
86161
|
-
var
|
|
86162
|
-
switch (
|
|
86174
|
+
var state_11 = _loop_35(baseProperty);
|
|
86175
|
+
switch (state_11) {
|
|
86163
86176
|
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
86164
86177
|
}
|
|
86165
86178
|
}
|
|
@@ -91135,27 +91148,17 @@ var ts;
|
|
|
91135
91148
|
})(ts || (ts = {}));
|
|
91136
91149
|
var ts;
|
|
91137
91150
|
(function (ts) {
|
|
91138
|
-
// TODO(jakebailey): include type guard and non-type guard variants on visitNode and visitNodes
|
|
91139
91151
|
var _a;
|
|
91140
|
-
/**
|
|
91141
|
-
* Visits a Node using the supplied visitor, possibly returning a new Node in its place.
|
|
91142
|
-
*
|
|
91143
|
-
* @param node The Node to visit.
|
|
91144
|
-
* @param visitor The callback used to visit the Node.
|
|
91145
|
-
* @param test A callback to execute to verify the Node is valid.
|
|
91146
|
-
* @param lift An optional callback to execute to lift a NodeArray into a valid Node.
|
|
91147
|
-
*/
|
|
91148
91152
|
function visitNode(node, visitor, test, lift) {
|
|
91149
|
-
if (node === undefined) {
|
|
91150
|
-
|
|
91153
|
+
if (node === undefined || visitor === undefined) {
|
|
91154
|
+
return node;
|
|
91155
|
+
}
|
|
91156
|
+
var visited = visitor(node);
|
|
91157
|
+
if (visited === node) {
|
|
91151
91158
|
return node;
|
|
91152
91159
|
}
|
|
91153
|
-
var visited = visitor ? visitor(node) : node;
|
|
91154
91160
|
var visitedNode;
|
|
91155
91161
|
if (visited === undefined) {
|
|
91156
|
-
// If the visited node is undefined, then the visitor must have returned undefined,
|
|
91157
|
-
// so the visitor must have been declared as able to return undefined, so TOut must be
|
|
91158
|
-
// potentially undefined.
|
|
91159
91162
|
return undefined;
|
|
91160
91163
|
}
|
|
91161
91164
|
else if (ts.isArray(visited)) {
|
|
@@ -91168,7 +91171,6 @@ var ts;
|
|
|
91168
91171
|
return visitedNode;
|
|
91169
91172
|
}
|
|
91170
91173
|
ts.visitNode = visitNode;
|
|
91171
|
-
(function (_) { })(visitNode); // Check that visitNode is a NodeVisitor.
|
|
91172
91174
|
/**
|
|
91173
91175
|
* Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
|
|
91174
91176
|
*
|
|
@@ -91179,8 +91181,7 @@ var ts;
|
|
|
91179
91181
|
* @param count An optional value indicating the maximum number of nodes to visit.
|
|
91180
91182
|
*/
|
|
91181
91183
|
function visitNodes(nodes, visitor, test, start, count) {
|
|
91182
|
-
if (nodes === undefined) {
|
|
91183
|
-
// If the input type is undefined, then the output type can be undefined.
|
|
91184
|
+
if (nodes === undefined || visitor === undefined) {
|
|
91184
91185
|
return nodes;
|
|
91185
91186
|
}
|
|
91186
91187
|
// Ensure start and count have valid values
|
|
@@ -91211,17 +91212,11 @@ var ts;
|
|
|
91211
91212
|
ts.setTextRangePosEnd(updatedArray, pos, end);
|
|
91212
91213
|
return updatedArray;
|
|
91213
91214
|
}
|
|
91214
|
-
// If we are here, updated === nodes. This means that it's still a NodeArray,
|
|
91215
|
-
// and also that its contents passed the tests in visitArrayWorker, so has contents
|
|
91216
|
-
// of type TOut.
|
|
91217
91215
|
return nodes;
|
|
91218
91216
|
}
|
|
91219
91217
|
ts.visitNodes = visitNodes;
|
|
91220
|
-
(function (_) { })(visitNodes); // Check that visitNode is a NodeVisitor.
|
|
91221
|
-
/* @internal */
|
|
91222
91218
|
function visitArray(nodes, visitor, test, start, count) {
|
|
91223
91219
|
if (nodes === undefined) {
|
|
91224
|
-
// If the input type is undefined, then the output type can be undefined.
|
|
91225
91220
|
return nodes;
|
|
91226
91221
|
}
|
|
91227
91222
|
// Ensure start and count have valid values
|
|
@@ -91246,7 +91241,7 @@ var ts;
|
|
|
91246
91241
|
// Visit each original node.
|
|
91247
91242
|
for (var i = 0; i < count; i++) {
|
|
91248
91243
|
var node = nodes[i + start];
|
|
91249
|
-
var visited = node !== undefined ?
|
|
91244
|
+
var visited = node !== undefined ? visitor(node) : undefined;
|
|
91250
91245
|
if (updated !== undefined || visited === undefined || visited !== node) {
|
|
91251
91246
|
if (updated === undefined) {
|
|
91252
91247
|
// Ensure we have a copy of `nodes`, up to the current index.
|
|
@@ -91256,20 +91251,18 @@ var ts;
|
|
|
91256
91251
|
if (ts.isArray(visited)) {
|
|
91257
91252
|
for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) {
|
|
91258
91253
|
var visitedNode = visited_1[_i];
|
|
91259
|
-
|
|
91254
|
+
void ts.Debug.assertNode(visitedNode, test);
|
|
91260
91255
|
updated.push(visitedNode);
|
|
91261
91256
|
}
|
|
91262
91257
|
}
|
|
91263
91258
|
else {
|
|
91264
|
-
|
|
91259
|
+
void ts.Debug.assertNode(visited, test);
|
|
91265
91260
|
updated.push(visited);
|
|
91266
91261
|
}
|
|
91267
91262
|
}
|
|
91268
91263
|
}
|
|
91269
91264
|
}
|
|
91270
|
-
|
|
91271
|
-
ts.Debug.assertEachNode(result, test);
|
|
91272
|
-
return result;
|
|
91265
|
+
return updated !== null && updated !== void 0 ? updated : nodes;
|
|
91273
91266
|
}
|
|
91274
91267
|
/**
|
|
91275
91268
|
* Starts a new lexical environment and visits a statement list, ending the lexical environment
|
|
@@ -91290,7 +91283,7 @@ var ts;
|
|
|
91290
91283
|
context.startLexicalEnvironment();
|
|
91291
91284
|
if (nodes) {
|
|
91292
91285
|
context.setLexicalEnvironmentFlags(1 /* LexicalEnvironmentFlags.InParameters */, true);
|
|
91293
|
-
updated = nodesVisitor(nodes, visitor, ts.
|
|
91286
|
+
updated = nodesVisitor(nodes, visitor, ts.isParameterDeclaration);
|
|
91294
91287
|
// As of ES2015, any runtime execution of that occurs in for a parameter (such as evaluating an
|
|
91295
91288
|
// initializer or a binding pattern), occurs in its own lexical scope. As a result, any expression
|
|
91296
91289
|
// that we might transform that introduces a temporary variable would fail as the temporary variable
|
|
@@ -91373,7 +91366,6 @@ var ts;
|
|
|
91373
91366
|
if (nodeVisitor === void 0) { nodeVisitor = visitNode; }
|
|
91374
91367
|
context.startBlockScope();
|
|
91375
91368
|
var updated = nodeVisitor(body, visitor, ts.isStatement, context.factory.liftToBlock);
|
|
91376
|
-
ts.Debug.assert(updated);
|
|
91377
91369
|
var declarations = context.endBlockScope();
|
|
91378
91370
|
if (ts.some(declarations)) {
|
|
91379
91371
|
if (ts.isBlock(updated)) {
|
|
@@ -91413,23 +91405,23 @@ var ts;
|
|
|
91413
91405
|
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));
|
|
91414
91406
|
},
|
|
91415
91407
|
_a[166 /* SyntaxKind.Parameter */] = function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
|
|
91416
|
-
return context.factory.updateParameterDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isDotDotDotToken),
|
|
91408
|
+
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));
|
|
91417
91409
|
},
|
|
91418
91410
|
_a[167 /* SyntaxKind.Decorator */] = function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91419
91411
|
return context.factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
91420
91412
|
},
|
|
91421
91413
|
// Type elements
|
|
91422
91414
|
_a[168 /* SyntaxKind.PropertySignature */] = function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
|
|
91423
|
-
return context.factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.
|
|
91415
|
+
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));
|
|
91424
91416
|
},
|
|
91425
91417
|
_a[169 /* SyntaxKind.PropertyDeclaration */] = function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
|
|
91426
91418
|
var _a;
|
|
91427
|
-
return context.factory.updatePropertyDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike),
|
|
91419
|
+
return context.factory.updatePropertyDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), nodeVisitor(node.name, visitor, ts.isPropertyName),
|
|
91428
91420
|
// QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration
|
|
91429
91421
|
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));
|
|
91430
91422
|
},
|
|
91431
91423
|
_a[170 /* SyntaxKind.MethodSignature */] = function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
|
|
91432
|
-
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.
|
|
91424
|
+
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));
|
|
91433
91425
|
},
|
|
91434
91426
|
_a[171 /* SyntaxKind.MethodDeclaration */] = function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
|
|
91435
91427
|
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));
|
|
@@ -91449,13 +91441,13 @@ var ts;
|
|
|
91449
91441
|
return context.factory.updateClassStaticBlockDeclaration(node, visitFunctionBody(node.body, visitor, context, nodeVisitor));
|
|
91450
91442
|
},
|
|
91451
91443
|
_a[176 /* SyntaxKind.CallSignature */] = function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91452
|
-
return context.factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.
|
|
91444
|
+
return context.factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91453
91445
|
},
|
|
91454
91446
|
_a[177 /* SyntaxKind.ConstructSignature */] = function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91455
|
-
return context.factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.
|
|
91447
|
+
return context.factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91456
91448
|
},
|
|
91457
91449
|
_a[178 /* SyntaxKind.IndexSignature */] = function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91458
|
-
return context.factory.updateIndexSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.
|
|
91450
|
+
return context.factory.updateIndexSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91459
91451
|
},
|
|
91460
91452
|
// Types
|
|
91461
91453
|
_a[179 /* SyntaxKind.TypePredicate */] = function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
@@ -91465,10 +91457,10 @@ var ts;
|
|
|
91465
91457
|
return context.factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
|
|
91466
91458
|
},
|
|
91467
91459
|
_a[181 /* SyntaxKind.FunctionType */] = function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91468
|
-
return context.factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.
|
|
91460
|
+
return context.factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
91469
91461
|
},
|
|
91470
91462
|
_a[182 /* SyntaxKind.ConstructorType */] = function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91471
|
-
return context.factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.
|
|
91463
|
+
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));
|
|
91472
91464
|
},
|
|
91473
91465
|
_a[183 /* SyntaxKind.TypeQuery */] = function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91474
91466
|
return context.factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
|
|
@@ -91522,7 +91514,7 @@ var ts;
|
|
|
91522
91514
|
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));
|
|
91523
91515
|
},
|
|
91524
91516
|
_a[198 /* SyntaxKind.LiteralType */] = function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91525
|
-
return context.factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.
|
|
91517
|
+
return context.factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression));
|
|
91526
91518
|
},
|
|
91527
91519
|
_a[200 /* SyntaxKind.TemplateLiteralType */] = function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91528
91520
|
return context.factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan));
|
|
@@ -93012,7 +93004,6 @@ var ts;
|
|
|
93012
93004
|
};
|
|
93013
93005
|
if (value) {
|
|
93014
93006
|
value = ts.visitNode(value, visitor, ts.isExpression);
|
|
93015
|
-
ts.Debug.assert(value);
|
|
93016
93007
|
if (ts.isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText) ||
|
|
93017
93008
|
bindingOrAssignmentElementContainsNonLiteralComputedName(node)) {
|
|
93018
93009
|
// If the right-hand value of the assignment is also an assignment target then
|
|
@@ -93239,7 +93230,7 @@ var ts;
|
|
|
93239
93230
|
&& !(element.transformFlags & (32768 /* TransformFlags.ContainsRestOrSpread */ | 65536 /* TransformFlags.ContainsObjectRestOrSpread */))
|
|
93240
93231
|
&& !(ts.getTargetOfBindingOrAssignmentElement(element).transformFlags & (32768 /* TransformFlags.ContainsRestOrSpread */ | 65536 /* TransformFlags.ContainsObjectRestOrSpread */))
|
|
93241
93232
|
&& !ts.isComputedPropertyName(propertyName)) {
|
|
93242
|
-
bindingElements = ts.append(bindingElements, ts.visitNode(element, flattenContext.visitor
|
|
93233
|
+
bindingElements = ts.append(bindingElements, ts.visitNode(element, flattenContext.visitor));
|
|
93243
93234
|
}
|
|
93244
93235
|
else {
|
|
93245
93236
|
if (bindingElements) {
|
|
@@ -93420,7 +93411,6 @@ var ts;
|
|
|
93420
93411
|
return factory.createArrayBindingPattern(elements);
|
|
93421
93412
|
}
|
|
93422
93413
|
function makeArrayAssignmentPattern(factory, elements) {
|
|
93423
|
-
ts.Debug.assertEachNode(elements, ts.isArrayBindingOrAssignmentElement);
|
|
93424
93414
|
return factory.createArrayLiteralExpression(ts.map(elements, factory.converters.convertToArrayAssignmentElement));
|
|
93425
93415
|
}
|
|
93426
93416
|
function makeObjectBindingPattern(factory, elements) {
|
|
@@ -93428,7 +93418,6 @@ var ts;
|
|
|
93428
93418
|
return factory.createObjectBindingPattern(elements);
|
|
93429
93419
|
}
|
|
93430
93420
|
function makeObjectAssignmentPattern(factory, elements) {
|
|
93431
|
-
ts.Debug.assertEachNode(elements, ts.isObjectBindingOrAssignmentElement);
|
|
93432
93421
|
return factory.createObjectLiteralExpression(ts.map(elements, factory.converters.convertToObjectAssignmentElement));
|
|
93433
93422
|
}
|
|
93434
93423
|
function makeBindingElement(factory, name) {
|
|
@@ -93449,7 +93438,6 @@ var ts;
|
|
|
93449
93438
|
function processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, level) {
|
|
93450
93439
|
// Visit the tag expression
|
|
93451
93440
|
var tag = ts.visitNode(node.tag, visitor, ts.isExpression);
|
|
93452
|
-
ts.Debug.assert(tag);
|
|
93453
93441
|
// Build up the template arguments and the raw and cooked strings for the template.
|
|
93454
93442
|
// We start out with 'undefined' for the first argument and revisit later
|
|
93455
93443
|
// to avoid walking over the template string twice and shifting all our arguments over after the fact.
|
|
@@ -94015,7 +94003,7 @@ var ts;
|
|
|
94015
94003
|
return factory.updateSourceFile(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, /*start*/ 0, alwaysStrict));
|
|
94016
94004
|
}
|
|
94017
94005
|
function visitObjectLiteralExpression(node) {
|
|
94018
|
-
return factory.updateObjectLiteralExpression(node, ts.visitNodes(node.properties, getObjectLiteralElementVisitor(node), ts.
|
|
94006
|
+
return factory.updateObjectLiteralExpression(node, ts.visitNodes(node.properties, getObjectLiteralElementVisitor(node), ts.isObjectLiteralElement));
|
|
94019
94007
|
}
|
|
94020
94008
|
function getClassFacts(node, staticProperties) {
|
|
94021
94009
|
var facts = 0 /* ClassFacts.None */;
|
|
@@ -94201,7 +94189,6 @@ var ts;
|
|
|
94201
94189
|
for (var _i = 0, parameterDecorators_1 = parameterDecorators; _i < parameterDecorators_1.length; _i++) {
|
|
94202
94190
|
var parameterDecorator = parameterDecorators_1[_i];
|
|
94203
94191
|
var expression = ts.visitNode(parameterDecorator.expression, visitor, ts.isExpression);
|
|
94204
|
-
ts.Debug.assert(expression);
|
|
94205
94192
|
var helper = emitHelpers().createParamHelper(expression, parameterOffset);
|
|
94206
94193
|
ts.setTextRange(helper, parameterDecorator.expression);
|
|
94207
94194
|
ts.setEmitFlags(helper, 1536 /* EmitFlags.NoComments */);
|
|
@@ -94344,7 +94331,6 @@ var ts;
|
|
|
94344
94331
|
// - the property has a decorator.
|
|
94345
94332
|
if (ts.isComputedPropertyName(name) && ((!ts.hasStaticModifier(member) && currentClassHasParameterProperties) || ts.hasDecorators(member))) {
|
|
94346
94333
|
var expression = ts.visitNode(name.expression, visitor, ts.isExpression);
|
|
94347
|
-
ts.Debug.assert(expression);
|
|
94348
94334
|
var innerExpression = ts.skipPartiallyEmittedExpressions(expression);
|
|
94349
94335
|
if (!ts.isSimpleInlineableExpression(innerExpression)) {
|
|
94350
94336
|
var generatedName = factory.getGeneratedNameForNode(name);
|
|
@@ -94379,7 +94365,7 @@ var ts;
|
|
|
94379
94365
|
* @param node The ExpressionWithTypeArguments to transform.
|
|
94380
94366
|
*/
|
|
94381
94367
|
function visitExpressionWithTypeArguments(node) {
|
|
94382
|
-
return factory.updateExpressionWithTypeArguments(node, ts.
|
|
94368
|
+
return factory.updateExpressionWithTypeArguments(node, ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression),
|
|
94383
94369
|
/*typeArguments*/ undefined);
|
|
94384
94370
|
}
|
|
94385
94371
|
/**
|
|
@@ -94400,7 +94386,7 @@ var ts;
|
|
|
94400
94386
|
var decorators = transformAllDecoratorsOfDeclaration(node, parent, allDecorators);
|
|
94401
94387
|
// Preserve a `declare x` property with decorators to be handled by the decorators transform
|
|
94402
94388
|
if (isAmbient) {
|
|
94403
|
-
return factory.updatePropertyDeclaration(node, ts.concatenate(decorators, factory.createModifiersFromModifierFlags(2 /* ModifierFlags.Ambient */)), ts.
|
|
94389
|
+
return factory.updatePropertyDeclaration(node, ts.concatenate(decorators, factory.createModifiersFromModifierFlags(2 /* ModifierFlags.Ambient */)), ts.visitNode(node.name, visitor, ts.isPropertyName),
|
|
94404
94390
|
/*questionOrExclamationToken*/ undefined,
|
|
94405
94391
|
/*type*/ undefined,
|
|
94406
94392
|
/*initializer*/ undefined);
|
|
@@ -94561,7 +94547,7 @@ var ts;
|
|
|
94561
94547
|
return undefined;
|
|
94562
94548
|
}
|
|
94563
94549
|
var updated = factory.updateParameterDeclaration(node, ts.elideNodes(factory, node.modifiers), // preserve positions, if available
|
|
94564
|
-
node.dotDotDotToken, ts.
|
|
94550
|
+
node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName),
|
|
94565
94551
|
/*questionToken*/ undefined,
|
|
94566
94552
|
/*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
|
|
94567
94553
|
if (updated !== node) {
|
|
@@ -94613,7 +94599,6 @@ var ts;
|
|
|
94613
94599
|
// Make sure we consider all nested cast expressions, e.g.:
|
|
94614
94600
|
// (<any><number><any>-A).x;
|
|
94615
94601
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
94616
|
-
ts.Debug.assert(expression);
|
|
94617
94602
|
// We have an expression of the form: (<Type>SubExpr). Emitting this as (SubExpr)
|
|
94618
94603
|
// is really not desirable. We would like to emit the subexpression as-is. Omitting
|
|
94619
94604
|
// the parentheses, however, could cause change in the semantics of the generated
|
|
@@ -94637,17 +94622,14 @@ var ts;
|
|
|
94637
94622
|
}
|
|
94638
94623
|
function visitAssertionExpression(node) {
|
|
94639
94624
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
94640
|
-
ts.Debug.assert(expression);
|
|
94641
94625
|
return factory.createPartiallyEmittedExpression(expression, node);
|
|
94642
94626
|
}
|
|
94643
94627
|
function visitNonNullExpression(node) {
|
|
94644
94628
|
var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression);
|
|
94645
|
-
ts.Debug.assert(expression);
|
|
94646
94629
|
return factory.createPartiallyEmittedExpression(expression, node);
|
|
94647
94630
|
}
|
|
94648
94631
|
function visitSatisfiesExpression(node) {
|
|
94649
94632
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
94650
|
-
ts.Debug.assert(expression);
|
|
94651
94633
|
return factory.createPartiallyEmittedExpression(expression, node);
|
|
94652
94634
|
}
|
|
94653
94635
|
function visitCallExpression(node) {
|
|
@@ -94660,7 +94642,7 @@ var ts;
|
|
|
94660
94642
|
}
|
|
94661
94643
|
function visitTaggedTemplateExpression(node) {
|
|
94662
94644
|
return factory.updateTaggedTemplateExpression(node, ts.visitNode(node.tag, visitor, ts.isExpression),
|
|
94663
|
-
/*typeArguments*/ undefined, ts.visitNode(node.template, visitor, ts.
|
|
94645
|
+
/*typeArguments*/ undefined, ts.visitNode(node.template, visitor, ts.isExpression));
|
|
94664
94646
|
}
|
|
94665
94647
|
function visitJsxSelfClosingElement(node) {
|
|
94666
94648
|
return factory.updateJsxSelfClosingElement(node, ts.visitNode(node.tagName, visitor, ts.isJsxTagNameExpression),
|
|
@@ -95690,7 +95672,6 @@ var ts;
|
|
|
95690
95672
|
var info = accessPrivateIdentifier(node.left);
|
|
95691
95673
|
if (info) {
|
|
95692
95674
|
var receiver = ts.visitNode(node.right, visitor, ts.isExpression);
|
|
95693
|
-
ts.Debug.assert(receiver);
|
|
95694
95675
|
return ts.setOriginalNode(context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node);
|
|
95695
95676
|
}
|
|
95696
95677
|
// Private name has not been declared. Subsequent transformers will handle this error
|
|
@@ -95707,7 +95688,6 @@ var ts;
|
|
|
95707
95688
|
}
|
|
95708
95689
|
function visitComputedPropertyName(node) {
|
|
95709
95690
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
95710
|
-
ts.Debug.assert(expression);
|
|
95711
95691
|
if (ts.some(pendingExpressions)) {
|
|
95712
95692
|
if (ts.isParenthesizedExpression(expression)) {
|
|
95713
95693
|
expression = factory.updateParenthesizedExpression(expression, factory.inlineExpressions(__spreadArray(__spreadArray([], pendingExpressions, true), [expression.expression], false)));
|
|
@@ -95787,7 +95767,6 @@ var ts;
|
|
|
95787
95767
|
var temp = factory.createTempVariable(hoistVariableDeclaration);
|
|
95788
95768
|
ts.setSourceMapRange(temp, name.expression);
|
|
95789
95769
|
var expression = ts.visitNode(name.expression, visitor, ts.isExpression);
|
|
95790
|
-
ts.Debug.assert(expression);
|
|
95791
95770
|
var assignment = factory.createAssignment(temp, expression);
|
|
95792
95771
|
ts.setSourceMapRange(assignment, name.expression);
|
|
95793
95772
|
getterName = factory.updateComputedPropertyName(name, factory.inlineExpressions([assignment, temp]));
|
|
@@ -95938,7 +95917,6 @@ var ts;
|
|
|
95938
95917
|
var info = void 0;
|
|
95939
95918
|
if (info = accessPrivateIdentifier(operand.name)) {
|
|
95940
95919
|
var receiver = ts.visitNode(operand.expression, visitor, ts.isExpression);
|
|
95941
|
-
ts.Debug.assert(receiver);
|
|
95942
95920
|
var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;
|
|
95943
95921
|
var expression = createPrivateIdentifierAccess(info, readExpression);
|
|
95944
95922
|
var temp = ts.isPrefixUnaryExpression(node) || valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
|
|
@@ -96142,17 +96120,14 @@ var ts;
|
|
|
96142
96120
|
var superPropertyGet = factory.createReflectGetCall(superClassReference, getterName, classConstructor);
|
|
96143
96121
|
ts.setOriginalNode(superPropertyGet, node.left);
|
|
96144
96122
|
ts.setTextRange(superPropertyGet, node.left);
|
|
96145
|
-
ts.Debug.assert(expression);
|
|
96146
96123
|
expression = factory.createBinaryExpression(superPropertyGet, ts.getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), expression);
|
|
96147
96124
|
ts.setTextRange(expression, node);
|
|
96148
96125
|
}
|
|
96149
96126
|
var temp = valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
|
|
96150
96127
|
if (temp) {
|
|
96151
|
-
ts.Debug.assert(expression);
|
|
96152
96128
|
expression = factory.createAssignment(temp, expression);
|
|
96153
96129
|
ts.setTextRange(temp, node);
|
|
96154
96130
|
}
|
|
96155
|
-
ts.Debug.assert(expression);
|
|
96156
96131
|
expression = factory.createReflectSetCall(superClassReference, setterName, expression, classConstructor);
|
|
96157
96132
|
ts.setOriginalNode(expression, node);
|
|
96158
96133
|
ts.setTextRange(expression, node);
|
|
@@ -96912,7 +96887,6 @@ var ts;
|
|
|
96912
96887
|
function getPropertyNameExpressionIfNeeded(name, shouldHoist) {
|
|
96913
96888
|
if (ts.isComputedPropertyName(name)) {
|
|
96914
96889
|
var expression = ts.visitNode(name.expression, visitor, ts.isExpression);
|
|
96915
|
-
ts.Debug.assert(expression);
|
|
96916
96890
|
var innerExpression = ts.skipPartiallyEmittedExpressions(expression);
|
|
96917
96891
|
var inlinable = ts.isSimpleInlineableExpression(innerExpression);
|
|
96918
96892
|
var alreadyTransformed = ts.isAssignmentExpression(innerExpression) && ts.isGeneratedIdentifier(innerExpression.left);
|
|
@@ -97236,8 +97210,7 @@ var ts;
|
|
|
97236
97210
|
//
|
|
97237
97211
|
// Transformation:
|
|
97238
97212
|
// [ { set value(x) { this.#myProp = x; } }.value ] = [ "hello" ];
|
|
97239
|
-
return factory.updateArrayLiteralExpression(node, ts.visitNodes(node.elements, visitArrayAssignmentTarget, ts.isExpression)
|
|
97240
|
-
);
|
|
97213
|
+
return factory.updateArrayLiteralExpression(node, ts.visitNodes(node.elements, visitArrayAssignmentTarget, ts.isExpression));
|
|
97241
97214
|
}
|
|
97242
97215
|
else {
|
|
97243
97216
|
// Transforms private names in destructuring assignment object bindings.
|
|
@@ -97957,7 +97930,7 @@ var ts;
|
|
|
97957
97930
|
/*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), ts.visitNodes(node.members, visitor, ts.isClassElement));
|
|
97958
97931
|
}
|
|
97959
97932
|
function visitConstructorDeclaration(node) {
|
|
97960
|
-
return factory.updateConstructorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNodes(node.parameters, visitor, ts.
|
|
97933
|
+
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));
|
|
97961
97934
|
}
|
|
97962
97935
|
function finishClassElement(updated, original) {
|
|
97963
97936
|
if (updated !== original) {
|
|
@@ -97971,26 +97944,26 @@ var ts;
|
|
|
97971
97944
|
function visitMethodDeclaration(node) {
|
|
97972
97945
|
return finishClassElement(factory.updateMethodDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName),
|
|
97973
97946
|
/*questionToken*/ undefined,
|
|
97974
|
-
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.
|
|
97947
|
+
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration),
|
|
97975
97948
|
/*type*/ undefined, ts.visitNode(node.body, visitor, ts.isBlock)), node);
|
|
97976
97949
|
}
|
|
97977
97950
|
function visitGetAccessorDeclaration(node) {
|
|
97978
|
-
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.
|
|
97951
|
+
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),
|
|
97979
97952
|
/*type*/ undefined, ts.visitNode(node.body, visitor, ts.isBlock)), node);
|
|
97980
97953
|
}
|
|
97981
97954
|
function visitSetAccessorDeclaration(node) {
|
|
97982
|
-
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.
|
|
97955
|
+
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);
|
|
97983
97956
|
}
|
|
97984
97957
|
function visitPropertyDeclaration(node) {
|
|
97985
97958
|
if (node.flags & 16777216 /* NodeFlags.Ambient */ || ts.hasSyntacticModifier(node, 2 /* ModifierFlags.Ambient */)) {
|
|
97986
97959
|
return undefined;
|
|
97987
97960
|
}
|
|
97988
|
-
return finishClassElement(factory.updatePropertyDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.
|
|
97961
|
+
return finishClassElement(factory.updatePropertyDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName),
|
|
97989
97962
|
/*questionOrExclamationToken*/ undefined,
|
|
97990
97963
|
/*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)), node);
|
|
97991
97964
|
}
|
|
97992
97965
|
function visitParameterDeclaration(node) {
|
|
97993
|
-
var updated = factory.updateParameterDeclaration(node, ts.elideNodes(factory, node.modifiers), node.dotDotDotToken, ts.
|
|
97966
|
+
var updated = factory.updateParameterDeclaration(node, ts.elideNodes(factory, node.modifiers), node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName),
|
|
97994
97967
|
/*questionToken*/ undefined,
|
|
97995
97968
|
/*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
|
|
97996
97969
|
if (updated !== node) {
|
|
@@ -98164,7 +98137,7 @@ var ts;
|
|
|
98164
98137
|
* @param decorator The decorator node.
|
|
98165
98138
|
*/
|
|
98166
98139
|
function transformDecorator(decorator) {
|
|
98167
|
-
return ts.
|
|
98140
|
+
return ts.visitNode(decorator.expression, visitor, ts.isExpression);
|
|
98168
98141
|
}
|
|
98169
98142
|
/**
|
|
98170
98143
|
* Transforms the decorators of a parameter.
|
|
@@ -98475,7 +98448,7 @@ var ts;
|
|
|
98475
98448
|
: ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, asyncBodyVisitor, context));
|
|
98476
98449
|
}
|
|
98477
98450
|
function visitForOfStatementInAsyncBody(node) {
|
|
98478
|
-
return factory.updateForOfStatement(node, ts.visitNode(node.awaitModifier, visitor, ts.
|
|
98451
|
+
return factory.updateForOfStatement(node, ts.visitNode(node.awaitModifier, visitor, ts.isToken), isVariableDeclarationListWithCollidingName(node.initializer)
|
|
98479
98452
|
? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true)
|
|
98480
98453
|
: ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, asyncBodyVisitor, context));
|
|
98481
98454
|
}
|
|
@@ -98540,7 +98513,7 @@ var ts;
|
|
|
98540
98513
|
* @param node The node to visit.
|
|
98541
98514
|
*/
|
|
98542
98515
|
function visitFunctionExpression(node) {
|
|
98543
|
-
return factory.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.
|
|
98516
|
+
return factory.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.asteriskToken, node.name,
|
|
98544
98517
|
/*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context),
|
|
98545
98518
|
/*type*/ undefined, ts.getFunctionFlags(node) & 2 /* FunctionFlags.Async */
|
|
98546
98519
|
? transformAsyncFunctionBody(node)
|
|
@@ -98555,7 +98528,7 @@ var ts;
|
|
|
98555
98528
|
* @param node The node to visit.
|
|
98556
98529
|
*/
|
|
98557
98530
|
function visitArrowFunction(node) {
|
|
98558
|
-
return factory.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.
|
|
98531
|
+
return factory.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike),
|
|
98559
98532
|
/*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context),
|
|
98560
98533
|
/*type*/ undefined, node.equalsGreaterThanToken, ts.getFunctionFlags(node) & 2 /* FunctionFlags.Async */
|
|
98561
98534
|
? transformAsyncFunctionBody(node)
|
|
@@ -98611,7 +98584,7 @@ var ts;
|
|
|
98611
98584
|
}
|
|
98612
98585
|
function transformInitializedVariable(node) {
|
|
98613
98586
|
var converted = ts.setSourceMapRange(factory.createAssignment(factory.converters.convertToAssignmentElementTarget(node.name), node.initializer), node);
|
|
98614
|
-
return ts.
|
|
98587
|
+
return ts.visitNode(converted, visitor, ts.isExpression);
|
|
98615
98588
|
}
|
|
98616
98589
|
function collidesWithParameterName(_a) {
|
|
98617
98590
|
var name = _a.name;
|
|
@@ -99475,7 +99448,7 @@ var ts;
|
|
|
99475
99448
|
? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifierLike)
|
|
99476
99449
|
: node.modifiers, enclosingFunctionFlags & 2 /* FunctionFlags.Async */
|
|
99477
99450
|
? undefined
|
|
99478
|
-
: node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(/*questionToken*/ undefined, visitor, ts.
|
|
99451
|
+
: node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(/*questionToken*/ undefined, visitor, ts.isToken),
|
|
99479
99452
|
/*typeParameters*/ undefined, ts.visitParameterList(node.parameters, parameterVisitor, context),
|
|
99480
99453
|
/*type*/ undefined, enclosingFunctionFlags & 2 /* FunctionFlags.Async */ && enclosingFunctionFlags & 1 /* FunctionFlags.Generator */
|
|
99481
99454
|
? transformAsyncGeneratorFunctionBody(node)
|
|
@@ -100364,7 +100337,7 @@ var ts;
|
|
|
100364
100337
|
return ts.singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions);
|
|
100365
100338
|
}
|
|
100366
100339
|
function transformJsxSpreadAttributeToExpression(node) {
|
|
100367
|
-
return ts.
|
|
100340
|
+
return ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
100368
100341
|
}
|
|
100369
100342
|
function transformJsxAttributeToObjectLiteralElement(node) {
|
|
100370
100343
|
var name = getAttributeName(node);
|
|
@@ -102032,7 +102005,6 @@ var ts;
|
|
|
102032
102005
|
var sourceMapRange = ts.getSourceMapRange(member);
|
|
102033
102006
|
var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined, container);
|
|
102034
102007
|
var propertyName = ts.visitNode(member.name, visitor, ts.isPropertyName);
|
|
102035
|
-
ts.Debug.assert(propertyName);
|
|
102036
102008
|
var e;
|
|
102037
102009
|
if (!ts.isPrivateIdentifier(propertyName) && ts.getUseDefineForClassFields(context.getCompilerOptions())) {
|
|
102038
102010
|
var name = ts.isComputedPropertyName(propertyName) ? propertyName.expression
|
|
@@ -102085,7 +102057,6 @@ var ts;
|
|
|
102085
102057
|
ts.setEmitFlags(target, 1536 /* EmitFlags.NoComments */ | 32 /* EmitFlags.NoTrailingSourceMap */);
|
|
102086
102058
|
ts.setSourceMapRange(target, firstAccessor.name);
|
|
102087
102059
|
var visitedAccessorName = ts.visitNode(firstAccessor.name, visitor, ts.isPropertyName);
|
|
102088
|
-
ts.Debug.assert(visitedAccessorName);
|
|
102089
102060
|
if (ts.isPrivateIdentifier(visitedAccessorName)) {
|
|
102090
102061
|
return ts.Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015.");
|
|
102091
102062
|
}
|
|
@@ -102360,7 +102331,6 @@ var ts;
|
|
|
102360
102331
|
var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression);
|
|
102361
102332
|
if (result || visited !== element) {
|
|
102362
102333
|
result || (result = node.elements.slice(0, i));
|
|
102363
|
-
ts.Debug.assert(visited);
|
|
102364
102334
|
result.push(visited);
|
|
102365
102335
|
}
|
|
102366
102336
|
}
|
|
@@ -102420,7 +102390,6 @@ var ts;
|
|
|
102420
102390
|
var declarations = ts.flatMap(node.declarations, node.flags & 1 /* NodeFlags.Let */
|
|
102421
102391
|
? visitVariableDeclarationInLetDeclarationList
|
|
102422
102392
|
: visitVariableDeclaration);
|
|
102423
|
-
ts.Debug.assertEachNode(declarations, ts.isVariableDeclaration); // TODO(jakebailey): side effect of VisitResult.
|
|
102424
102393
|
var declarationList = factory.createVariableDeclarationList(declarations);
|
|
102425
102394
|
ts.setOriginalNode(declarationList, node);
|
|
102426
102395
|
ts.setTextRange(declarationList, node);
|
|
@@ -102640,7 +102609,6 @@ var ts;
|
|
|
102640
102609
|
}
|
|
102641
102610
|
else {
|
|
102642
102611
|
var statement = ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock);
|
|
102643
|
-
ts.Debug.assert(statement);
|
|
102644
102612
|
if (ts.isBlock(statement)) {
|
|
102645
102613
|
return factory.updateBlock(statement, ts.setTextRange(factory.createNodeArray(ts.concatenate(statements, statement.statements)), statement.statements));
|
|
102646
102614
|
}
|
|
@@ -102676,7 +102644,6 @@ var ts;
|
|
|
102676
102644
|
// Note also that because an extra statement is needed to assign to the LHS,
|
|
102677
102645
|
// for-of bodies are always emitted as blocks.
|
|
102678
102646
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
102679
|
-
ts.Debug.assert(expression);
|
|
102680
102647
|
// In the case where the user wrote an identifier as the RHS, like this:
|
|
102681
102648
|
//
|
|
102682
102649
|
// for (let v of arr) { }
|
|
@@ -102702,7 +102669,6 @@ var ts;
|
|
|
102702
102669
|
}
|
|
102703
102670
|
function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) {
|
|
102704
102671
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
102705
|
-
ts.Debug.assert(expression);
|
|
102706
102672
|
var iterator = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable(/*recordTempVariable*/ undefined);
|
|
102707
102673
|
var result = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(iterator) : factory.createTempVariable(/*recordTempVariable*/ undefined);
|
|
102708
102674
|
var errorRecord = factory.createUniqueName("e");
|
|
@@ -103131,7 +103097,6 @@ var ts;
|
|
|
103131
103097
|
statements.push(factory.createIfStatement(factory.createPrefixUnaryExpression(53 /* SyntaxKind.ExclamationToken */, ts.visitNode(node.condition, visitor, ts.isExpression)), ts.visitNode(factory.createBreakStatement(), visitor, ts.isStatement)));
|
|
103132
103098
|
}
|
|
103133
103099
|
}
|
|
103134
|
-
ts.Debug.assert(statement);
|
|
103135
103100
|
if (ts.isBlock(statement)) {
|
|
103136
103101
|
ts.addRange(statements, statement.statements);
|
|
103137
103102
|
}
|
|
@@ -103772,9 +103737,7 @@ var ts;
|
|
|
103772
103737
|
return ts.map(chunk, visitExpressionOfSpread);
|
|
103773
103738
|
}
|
|
103774
103739
|
function visitExpressionOfSpread(node) {
|
|
103775
|
-
ts.Debug.assertNode(node, ts.isSpreadElement);
|
|
103776
103740
|
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
103777
|
-
ts.Debug.assert(expression);
|
|
103778
103741
|
// We don't need to pack already packed array literals, or existing calls to the `__read` helper.
|
|
103779
103742
|
var isCallToReadHelper = ts.isCallToHelper(expression, "___read");
|
|
103780
103743
|
var kind = isCallToReadHelper || ts.isPackedArrayLiteral(expression) ? 2 /* SpreadSegmentKind.PackedSpread */ : 1 /* SpreadSegmentKind.UnpackedSpread */;
|
|
@@ -103842,7 +103805,7 @@ var ts;
|
|
|
103842
103805
|
var expression = factory.createStringLiteral(node.head.text);
|
|
103843
103806
|
for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {
|
|
103844
103807
|
var span = _a[_i];
|
|
103845
|
-
var args = [ts.
|
|
103808
|
+
var args = [ts.visitNode(span.expression, visitor, ts.isExpression)];
|
|
103846
103809
|
if (span.literal.text.length > 0) {
|
|
103847
103810
|
args.push(factory.createStringLiteral(span.literal.text));
|
|
103848
103811
|
}
|
|
@@ -104743,7 +104706,7 @@ var ts;
|
|
|
104743
104706
|
// .yield resumeLabel
|
|
104744
104707
|
// .mark resumeLabel
|
|
104745
104708
|
// _a.b = %sent%;
|
|
104746
|
-
target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.
|
|
104709
|
+
target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);
|
|
104747
104710
|
break;
|
|
104748
104711
|
case 209 /* SyntaxKind.ElementAccessExpression */:
|
|
104749
104712
|
// [source]
|
|
@@ -104756,7 +104719,7 @@ var ts;
|
|
|
104756
104719
|
// .yield resumeLabel
|
|
104757
104720
|
// .mark resumeLabel
|
|
104758
104721
|
// _a[_b] = %sent%;
|
|
104759
|
-
target = factory.updateElementAccessExpression(left, cacheExpression(ts.
|
|
104722
|
+
target = factory.updateElementAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression)));
|
|
104760
104723
|
break;
|
|
104761
104724
|
default:
|
|
104762
104725
|
target = ts.visitNode(left, visitor, ts.isExpression);
|
|
@@ -105074,7 +105037,7 @@ var ts;
|
|
|
105074
105037
|
// .yield resumeLabel
|
|
105075
105038
|
// .mark resumeLabel
|
|
105076
105039
|
// a = _a[%sent%]
|
|
105077
|
-
return factory.updateElementAccessExpression(node, cacheExpression(ts.
|
|
105040
|
+
return factory.updateElementAccessExpression(node, cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)), ts.visitNode(node.argumentExpression, visitor, ts.isExpression));
|
|
105078
105041
|
}
|
|
105079
105042
|
return ts.visitEachChild(node, visitor, context);
|
|
105080
105043
|
}
|
|
@@ -105091,7 +105054,7 @@ var ts;
|
|
|
105091
105054
|
// .mark resumeLabel
|
|
105092
105055
|
// _b.apply(_a, _c.concat([%sent%, 2]));
|
|
105093
105056
|
var _a = factory.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion, /*cacheIdentifiers*/ true), target = _a.target, thisArg = _a.thisArg;
|
|
105094
|
-
return ts.setOriginalNode(ts.setTextRange(factory.createFunctionApplyCall(cacheExpression(ts.
|
|
105057
|
+
return ts.setOriginalNode(ts.setTextRange(factory.createFunctionApplyCall(cacheExpression(ts.visitNode(target, visitor, ts.isLeftHandSideExpression)), thisArg, visitElements(node.arguments)), node), node);
|
|
105095
105058
|
}
|
|
105096
105059
|
return ts.visitEachChild(node, visitor, context);
|
|
105097
105060
|
}
|
|
@@ -107076,7 +107039,7 @@ var ts;
|
|
|
107076
107039
|
*/
|
|
107077
107040
|
function addExportEqualsIfNeeded(statements, emitAsReturn) {
|
|
107078
107041
|
if (currentModuleInfo.exportEquals) {
|
|
107079
|
-
var expressionResult = ts.visitNode(currentModuleInfo.exportEquals.expression, visitor
|
|
107042
|
+
var expressionResult = ts.visitNode(currentModuleInfo.exportEquals.expression, visitor);
|
|
107080
107043
|
if (expressionResult) {
|
|
107081
107044
|
if (emitAsReturn) {
|
|
107082
107045
|
var statement = factory.createReturnStatement(expressionResult);
|
|
@@ -107276,7 +107239,7 @@ var ts;
|
|
|
107276
107239
|
}
|
|
107277
107240
|
function visitImportCallExpression(node) {
|
|
107278
107241
|
var externalModuleName = ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);
|
|
107279
|
-
var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor
|
|
107242
|
+
var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor);
|
|
107280
107243
|
// 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.
|
|
107281
107244
|
var argument = externalModuleName && (!firstArgument || !ts.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
|
|
107282
107245
|
var containsLexicalThis = !!(node.transformFlags & 16384 /* TransformFlags.ContainsLexicalThis */);
|
|
@@ -107624,7 +107587,7 @@ var ts;
|
|
|
107624
107587
|
var statements;
|
|
107625
107588
|
if (ts.hasSyntacticModifier(node, 1 /* ModifierFlags.Export */)) {
|
|
107626
107589
|
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),
|
|
107627
|
-
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor
|
|
107590
|
+
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor),
|
|
107628
107591
|
/*type*/ undefined, ts.visitEachChild(node.body, visitor, context)),
|
|
107629
107592
|
/*location*/ node),
|
|
107630
107593
|
/*original*/ node));
|
|
@@ -107651,7 +107614,7 @@ var ts;
|
|
|
107651
107614
|
var statements;
|
|
107652
107615
|
if (ts.hasSyntacticModifier(node, 1 /* ModifierFlags.Export */)) {
|
|
107653
107616
|
statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createClassDeclaration(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifierLike), factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
|
|
107654
|
-
/*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor
|
|
107617
|
+
/*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor), ts.visitNodes(node.members, visitor)), node), node));
|
|
107655
107618
|
}
|
|
107656
107619
|
else {
|
|
107657
107620
|
statements = ts.append(statements, ts.visitEachChild(node, visitor, context));
|
|
@@ -107691,7 +107654,7 @@ var ts;
|
|
|
107691
107654
|
if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) {
|
|
107692
107655
|
var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name),
|
|
107693
107656
|
/*location*/ variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name)));
|
|
107694
|
-
var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, visitor
|
|
107657
|
+
var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, visitor));
|
|
107695
107658
|
variables = ts.append(variables, updatedVariable);
|
|
107696
107659
|
expressions = ts.append(expressions, expression);
|
|
107697
107660
|
removeCommentsOnExpressions = true;
|
|
@@ -108719,7 +108682,7 @@ var ts;
|
|
|
108719
108682
|
function visitFunctionDeclaration(node) {
|
|
108720
108683
|
if (ts.hasSyntacticModifier(node, 1 /* ModifierFlags.Export */)) {
|
|
108721
108684
|
hoistedStatements = ts.append(hoistedStatements, factory.updateFunctionDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifierLike), node.asteriskToken, factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
|
|
108722
|
-
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.
|
|
108685
|
+
/*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration),
|
|
108723
108686
|
/*type*/ undefined, ts.visitNode(node.body, visitor, ts.isBlock)));
|
|
108724
108687
|
}
|
|
108725
108688
|
else {
|
|
@@ -109235,7 +109198,7 @@ var ts;
|
|
|
109235
109198
|
return expressions ? factory.inlineExpressions(expressions) : factory.createOmittedExpression();
|
|
109236
109199
|
}
|
|
109237
109200
|
else {
|
|
109238
|
-
return ts.visitNode(node, discardedValueVisitor, ts.
|
|
109201
|
+
return ts.visitNode(node, discardedValueVisitor, ts.isExpression);
|
|
109239
109202
|
}
|
|
109240
109203
|
}
|
|
109241
109204
|
/**
|
|
@@ -109407,7 +109370,7 @@ var ts;
|
|
|
109407
109370
|
// };
|
|
109408
109371
|
// });
|
|
109409
109372
|
var externalModuleName = ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);
|
|
109410
|
-
var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor
|
|
109373
|
+
var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor);
|
|
109411
109374
|
// 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.
|
|
109412
109375
|
var argument = externalModuleName && (!firstArgument || !ts.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
|
|
109413
109376
|
return factory.createCallExpression(factory.createPropertyAccessExpression(contextObject, factory.createIdentifier("import")),
|
|
@@ -110627,7 +110590,7 @@ var ts;
|
|
|
110627
110590
|
var _a;
|
|
110628
110591
|
var primaryDeclaration = (_a = parentSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return ts.getSourceFileOfNode(d) === containingFile; });
|
|
110629
110592
|
var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; });
|
|
110630
|
-
if (augmentingDeclarations) {
|
|
110593
|
+
if (primaryDeclaration && augmentingDeclarations) {
|
|
110631
110594
|
for (var _i = 0, augmentingDeclarations_1 = augmentingDeclarations; _i < augmentingDeclarations_1.length; _i++) {
|
|
110632
110595
|
var augmentations = augmentingDeclarations_1[_i];
|
|
110633
110596
|
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)));
|
|
@@ -110682,12 +110645,12 @@ var ts;
|
|
|
110682
110645
|
if (ts.isExternalOrCommonJsModule(sourceFile) || ts.isJsonSourceFile(sourceFile)) {
|
|
110683
110646
|
resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)
|
|
110684
110647
|
needsDeclare = false;
|
|
110685
|
-
var statements = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements
|
|
110648
|
+
var statements = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
|
|
110686
110649
|
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*/ []);
|
|
110687
110650
|
return newFile;
|
|
110688
110651
|
}
|
|
110689
110652
|
needsDeclare = true;
|
|
110690
|
-
var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements
|
|
110653
|
+
var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
|
|
110691
110654
|
return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);
|
|
110692
110655
|
}), ts.mapDefined(node.prepends, function (prepend) {
|
|
110693
110656
|
if (prepend.kind === 311 /* SyntaxKind.InputFiles */) {
|
|
@@ -110734,7 +110697,7 @@ var ts;
|
|
|
110734
110697
|
emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
|
|
110735
110698
|
}
|
|
110736
110699
|
else {
|
|
110737
|
-
var statements = ts.visitNodes(node.statements, visitDeclarationStatements
|
|
110700
|
+
var statements = ts.visitNodes(node.statements, visitDeclarationStatements);
|
|
110738
110701
|
combinedStatements = ts.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements);
|
|
110739
110702
|
refs.forEach(referenceVisitor);
|
|
110740
110703
|
emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
|
|
@@ -110832,10 +110795,10 @@ var ts;
|
|
|
110832
110795
|
}
|
|
110833
110796
|
else {
|
|
110834
110797
|
if (name.kind === 204 /* SyntaxKind.ArrayBindingPattern */) {
|
|
110835
|
-
return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement
|
|
110798
|
+
return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));
|
|
110836
110799
|
}
|
|
110837
110800
|
else {
|
|
110838
|
-
return factory.updateObjectBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement
|
|
110801
|
+
return factory.updateObjectBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));
|
|
110839
110802
|
}
|
|
110840
110803
|
}
|
|
110841
110804
|
function visitBindingElement(elem) {
|
|
@@ -110885,10 +110848,10 @@ var ts;
|
|
|
110885
110848
|
(resolver.isRequiredInitializedParameter(node) ||
|
|
110886
110849
|
resolver.isOptionalUninitializedParameterProperty(node));
|
|
110887
110850
|
if (type && !shouldUseResolverType) {
|
|
110888
|
-
return ts.visitNode(type, visitDeclarationSubtree
|
|
110851
|
+
return ts.visitNode(type, visitDeclarationSubtree);
|
|
110889
110852
|
}
|
|
110890
110853
|
if (!ts.getParseTreeNode(node)) {
|
|
110891
|
-
return type ? ts.visitNode(type, visitDeclarationSubtree
|
|
110854
|
+
return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */);
|
|
110892
110855
|
}
|
|
110893
110856
|
if (node.kind === 175 /* SyntaxKind.SetAccessor */) {
|
|
110894
110857
|
// 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
|
|
@@ -111001,7 +110964,7 @@ var ts;
|
|
|
111001
110964
|
return factory.createNodeArray(newParams || ts.emptyArray);
|
|
111002
110965
|
}
|
|
111003
110966
|
function ensureTypeParams(node, params) {
|
|
111004
|
-
return ts.hasEffectiveModifier(node, 8 /* ModifierFlags.Private */) ? undefined : ts.visitNodes(params, visitDeclarationSubtree
|
|
110967
|
+
return ts.hasEffectiveModifier(node, 8 /* ModifierFlags.Private */) ? undefined : ts.visitNodes(params, visitDeclarationSubtree);
|
|
111005
110968
|
}
|
|
111006
110969
|
function isEnclosingDeclaration(node) {
|
|
111007
110970
|
return ts.isSourceFile(node)
|
|
@@ -111133,7 +111096,6 @@ var ts;
|
|
|
111133
111096
|
var key = ts.getOriginalNodeId(statement);
|
|
111134
111097
|
if (lateStatementReplacementMap.has(key)) {
|
|
111135
111098
|
var result = lateStatementReplacementMap.get(key);
|
|
111136
|
-
ts.Debug.type(result);
|
|
111137
111099
|
lateStatementReplacementMap.delete(key);
|
|
111138
111100
|
if (result) {
|
|
111139
111101
|
if (ts.isArray(result) ? ts.some(result, ts.needsScopeMarker) : ts.needsScopeMarker(result)) {
|
|
@@ -111281,17 +111243,13 @@ var ts;
|
|
|
111281
111243
|
case 191 /* SyntaxKind.ConditionalType */: {
|
|
111282
111244
|
// We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration
|
|
111283
111245
|
// just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type.
|
|
111284
|
-
var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree
|
|
111285
|
-
var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree
|
|
111246
|
+
var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree);
|
|
111247
|
+
var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree);
|
|
111286
111248
|
var oldEnclosingDecl = enclosingDeclaration;
|
|
111287
111249
|
enclosingDeclaration = input.trueType;
|
|
111288
|
-
var trueType = ts.visitNode(input.trueType, visitDeclarationSubtree
|
|
111250
|
+
var trueType = ts.visitNode(input.trueType, visitDeclarationSubtree);
|
|
111289
111251
|
enclosingDeclaration = oldEnclosingDecl;
|
|
111290
|
-
var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree
|
|
111291
|
-
ts.Debug.assert(checkType);
|
|
111292
|
-
ts.Debug.assert(extendsType);
|
|
111293
|
-
ts.Debug.assert(trueType);
|
|
111294
|
-
ts.Debug.assert(falseType);
|
|
111252
|
+
var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree);
|
|
111295
111253
|
return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
|
|
111296
111254
|
}
|
|
111297
111255
|
case 181 /* SyntaxKind.FunctionType */: {
|
|
@@ -111429,7 +111387,7 @@ var ts;
|
|
|
111429
111387
|
return clean;
|
|
111430
111388
|
}
|
|
111431
111389
|
case 261 /* SyntaxKind.InterfaceDeclaration */: {
|
|
111432
|
-
return cleanup(factory.updateInterfaceDeclaration(input, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree
|
|
111390
|
+
return cleanup(factory.updateInterfaceDeclaration(input, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree)));
|
|
111433
111391
|
}
|
|
111434
111392
|
case 259 /* SyntaxKind.FunctionDeclaration */: {
|
|
111435
111393
|
// Generators lose their generator-ness, excepting their return type
|
|
@@ -111501,7 +111459,7 @@ var ts;
|
|
|
111501
111459
|
var oldHasScopeFix = resultHasScopeMarker;
|
|
111502
111460
|
resultHasScopeMarker = false;
|
|
111503
111461
|
needsScopeFixMarker = false;
|
|
111504
|
-
var statements = ts.visitNodes(inner.statements, visitDeclarationStatements
|
|
111462
|
+
var statements = ts.visitNodes(inner.statements, visitDeclarationStatements);
|
|
111505
111463
|
var lateStatements = transformAndReplaceLatePaintedStatements(statements);
|
|
111506
111464
|
if (input.flags & 16777216 /* NodeFlags.Ambient */) {
|
|
111507
111465
|
needsScopeFixMarker = false; // If it was `declare`'d everything is implicitly exported already, ignore late printed "privates"
|
|
@@ -111586,7 +111544,7 @@ var ts;
|
|
|
111586
111544
|
/*type*/ undefined,
|
|
111587
111545
|
/*initializer*/ undefined)
|
|
111588
111546
|
] : undefined;
|
|
111589
|
-
var memberNodes = ts.concatenate(ts.concatenate(privateIdentifier, parameterProperties), ts.visitNodes(input.members, visitDeclarationSubtree
|
|
111547
|
+
var memberNodes = ts.concatenate(ts.concatenate(privateIdentifier, parameterProperties), ts.visitNodes(input.members, visitDeclarationSubtree));
|
|
111590
111548
|
var members = factory.createNodeArray(memberNodes);
|
|
111591
111549
|
var extendsClause_1 = ts.getEffectiveBaseTypeNode(input);
|
|
111592
111550
|
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* SyntaxKind.NullKeyword */) {
|
|
@@ -111604,11 +111562,11 @@ var ts;
|
|
|
111604
111562
|
if (clause.token === 94 /* SyntaxKind.ExtendsKeyword */) {
|
|
111605
111563
|
var oldDiag_2 = getSymbolAccessibilityDiagnostic;
|
|
111606
111564
|
getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]);
|
|
111607
|
-
var newClause = factory.updateHeritageClause(clause, ts.map(clause.types, function (t) { return factory.updateExpressionWithTypeArguments(t, newId_1, ts.visitNodes(t.typeArguments, visitDeclarationSubtree
|
|
111565
|
+
var newClause = factory.updateHeritageClause(clause, ts.map(clause.types, function (t) { return factory.updateExpressionWithTypeArguments(t, newId_1, ts.visitNodes(t.typeArguments, visitDeclarationSubtree)); }));
|
|
111608
111566
|
getSymbolAccessibilityDiagnostic = oldDiag_2;
|
|
111609
111567
|
return newClause;
|
|
111610
111568
|
}
|
|
111611
|
-
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
|
|
111569
|
+
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));
|
|
111612
111570
|
}));
|
|
111613
111571
|
return [statement, cleanup(factory.updateClassDeclaration(input, modifiers, input.name, typeParameters, heritageClauses, members))]; // TODO: GH#18217
|
|
111614
111572
|
}
|
|
@@ -111653,7 +111611,7 @@ var ts;
|
|
|
111653
111611
|
function transformVariableStatement(input) {
|
|
111654
111612
|
if (!ts.forEach(input.declarationList.declarations, getBindingNameVisible))
|
|
111655
111613
|
return;
|
|
111656
|
-
var nodes = ts.visitNodes(input.declarationList.declarations, visitDeclarationSubtree
|
|
111614
|
+
var nodes = ts.visitNodes(input.declarationList.declarations, visitDeclarationSubtree);
|
|
111657
111615
|
if (!ts.length(nodes))
|
|
111658
111616
|
return;
|
|
111659
111617
|
return factory.updateVariableStatement(input, factory.createNodeArray(ensureModifiers(input)), factory.updateVariableDeclarationList(input.declarationList, nodes));
|
|
@@ -111736,7 +111694,7 @@ var ts;
|
|
|
111736
111694
|
function transformHeritageClauses(nodes) {
|
|
111737
111695
|
return factory.createNodeArray(ts.filter(ts.map(nodes, function (clause) { return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) {
|
|
111738
111696
|
return ts.isEntityNameExpression(t.expression) || (clause.token === 94 /* SyntaxKind.ExtendsKeyword */ && t.expression.kind === 104 /* SyntaxKind.NullKeyword */);
|
|
111739
|
-
})), visitDeclarationSubtree
|
|
111697
|
+
})), visitDeclarationSubtree)); }), function (clause) { return clause.types && !!clause.types.length; }));
|
|
111740
111698
|
}
|
|
111741
111699
|
}
|
|
111742
111700
|
ts.transformDeclarations = transformDeclarations;
|
|
@@ -115455,6 +115413,7 @@ var ts;
|
|
|
115455
115413
|
writeTrailingSemicolon();
|
|
115456
115414
|
}
|
|
115457
115415
|
function emitExportDeclaration(node) {
|
|
115416
|
+
emitModifiers(node, node.modifiers);
|
|
115458
115417
|
var nextPos = emitTokenWithComment(93 /* SyntaxKind.ExportKeyword */, node.pos, writeKeyword, node);
|
|
115459
115418
|
writeSpace();
|
|
115460
115419
|
if (node.isTypeOnly) {
|
|
@@ -118681,7 +118640,6 @@ var ts;
|
|
|
118681
118640
|
return resolutions;
|
|
118682
118641
|
}
|
|
118683
118642
|
ts.loadWithTypeDirectiveCache = loadWithTypeDirectiveCache;
|
|
118684
|
-
;
|
|
118685
118643
|
/**
|
|
118686
118644
|
* Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
|
|
118687
118645
|
* provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
|
|
@@ -123939,17 +123897,13 @@ var ts;
|
|
|
123939
123897
|
var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
|
|
123940
123898
|
return !!value && !!value.length;
|
|
123941
123899
|
}
|
|
123942
|
-
function createHasInvalidatedResolution(
|
|
123900
|
+
function createHasInvalidatedResolution(userProvidedHasInvalidatedResolution) {
|
|
123943
123901
|
// Ensure pending resolutions are applied
|
|
123944
123902
|
invalidateResolutionsOfFailedLookupLocations();
|
|
123945
|
-
if (forceAllFilesAsInvalidated) {
|
|
123946
|
-
// Any file asked would have invalidated resolution
|
|
123947
|
-
filesWithInvalidatedResolutions = undefined;
|
|
123948
|
-
return ts.returnTrue;
|
|
123949
|
-
}
|
|
123950
123903
|
var collected = filesWithInvalidatedResolutions;
|
|
123951
123904
|
filesWithInvalidatedResolutions = undefined;
|
|
123952
|
-
return function (path) { return (
|
|
123905
|
+
return function (path) { return (userProvidedHasInvalidatedResolution === null || userProvidedHasInvalidatedResolution === void 0 ? void 0 : userProvidedHasInvalidatedResolution(path)) ||
|
|
123906
|
+
!!(collected === null || collected === void 0 ? void 0 : collected.has(path)) ||
|
|
123953
123907
|
isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
|
|
123954
123908
|
}
|
|
123955
123909
|
function startCachingPerDirectoryResolution() {
|
|
@@ -125058,7 +125012,7 @@ var ts;
|
|
|
125058
125012
|
});
|
|
125059
125013
|
// Sort by paths closest to importing file Name directory
|
|
125060
125014
|
var sortedPaths = [];
|
|
125061
|
-
var
|
|
125015
|
+
var _loop_36 = function (directory) {
|
|
125062
125016
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
125063
125017
|
var pathsInDirectory;
|
|
125064
125018
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -125082,9 +125036,9 @@ var ts;
|
|
|
125082
125036
|
};
|
|
125083
125037
|
var out_directory_1;
|
|
125084
125038
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
125085
|
-
var
|
|
125039
|
+
var state_12 = _loop_36(directory);
|
|
125086
125040
|
directory = out_directory_1;
|
|
125087
|
-
if (
|
|
125041
|
+
if (state_12 === "break")
|
|
125088
125042
|
break;
|
|
125089
125043
|
}
|
|
125090
125044
|
if (allFileNames.size) {
|
|
@@ -125153,7 +125107,7 @@ var ts;
|
|
|
125153
125107
|
}
|
|
125154
125108
|
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
|
|
125155
125109
|
for (var key in paths) {
|
|
125156
|
-
var
|
|
125110
|
+
var _loop_37 = function (patternText_1) {
|
|
125157
125111
|
var pattern = ts.normalizePath(patternText_1);
|
|
125158
125112
|
var indexOfStar = pattern.indexOf("*");
|
|
125159
125113
|
// In module resolution, if `pattern` itself has an extension, a file with that extension is looked up directly,
|
|
@@ -125220,9 +125174,9 @@ var ts;
|
|
|
125220
125174
|
};
|
|
125221
125175
|
for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
|
|
125222
125176
|
var patternText_1 = _a[_i];
|
|
125223
|
-
var
|
|
125224
|
-
if (typeof
|
|
125225
|
-
return
|
|
125177
|
+
var state_13 = _loop_37(patternText_1);
|
|
125178
|
+
if (typeof state_13 === "object")
|
|
125179
|
+
return state_13.value;
|
|
125226
125180
|
}
|
|
125227
125181
|
}
|
|
125228
125182
|
function validateEnding(_a) {
|
|
@@ -125627,9 +125581,6 @@ var ts;
|
|
|
125627
125581
|
return "".concat(errorDiagnostic.file.fileName);
|
|
125628
125582
|
});
|
|
125629
125583
|
return filesInError.map(function (fileName) {
|
|
125630
|
-
if (fileName === undefined) {
|
|
125631
|
-
return undefined;
|
|
125632
|
-
}
|
|
125633
125584
|
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
125634
125585
|
return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
|
|
125635
125586
|
});
|
|
@@ -126266,8 +126217,6 @@ var ts;
|
|
|
126266
126217
|
parseConfigFile();
|
|
126267
126218
|
newLine = updateNewLine();
|
|
126268
126219
|
}
|
|
126269
|
-
ts.Debug.assert(compilerOptions);
|
|
126270
|
-
ts.Debug.assert(rootFileNames);
|
|
126271
126220
|
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
|
|
126272
126221
|
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
126273
126222
|
writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
|
|
@@ -126334,6 +126283,7 @@ var ts;
|
|
|
126334
126283
|
ts.maybeBind(host, host.getModuleResolutionCache) :
|
|
126335
126284
|
(function () { return resolutionCache.getModuleResolutionCache(); });
|
|
126336
126285
|
var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
126286
|
+
var userProvidedHasInvalidatedResolution = ts.maybeBind(host, host.hasInvalidatedResolution) || ts.returnTrue;
|
|
126337
126287
|
builderProgram = readBuilderProgram(compilerOptions, compilerHost);
|
|
126338
126288
|
synchronizeProgram();
|
|
126339
126289
|
// Update the wild card directory watch
|
|
@@ -126391,8 +126341,6 @@ var ts;
|
|
|
126391
126341
|
}
|
|
126392
126342
|
function synchronizeProgram() {
|
|
126393
126343
|
writeLog("Synchronizing program");
|
|
126394
|
-
ts.Debug.assert(compilerOptions);
|
|
126395
|
-
ts.Debug.assert(rootFileNames);
|
|
126396
126344
|
clearInvalidateResolutionsOfFailedLookupLocations();
|
|
126397
126345
|
var program = getCurrentBuilderProgram();
|
|
126398
126346
|
if (hasChangedCompilerOptions) {
|
|
@@ -126402,7 +126350,7 @@ var ts;
|
|
|
126402
126350
|
}
|
|
126403
126351
|
}
|
|
126404
126352
|
// All resolutions are invalid if user provided resolutions
|
|
126405
|
-
var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution);
|
|
126353
|
+
var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution ? userProvidedHasInvalidatedResolution : undefined);
|
|
126406
126354
|
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126407
126355
|
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126408
126356
|
if (hasChangedConfigFileParsingErrors) {
|
|
@@ -126641,8 +126589,6 @@ var ts;
|
|
|
126641
126589
|
}
|
|
126642
126590
|
function reloadFileNamesFromConfigFile() {
|
|
126643
126591
|
writeLog("Reloading new file names and options");
|
|
126644
|
-
ts.Debug.assert(compilerOptions);
|
|
126645
|
-
ts.Debug.assert(configFileName);
|
|
126646
126592
|
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
126647
126593
|
rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
|
126648
126594
|
if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
|
|
@@ -126652,7 +126598,6 @@ var ts;
|
|
|
126652
126598
|
synchronizeProgram();
|
|
126653
126599
|
}
|
|
126654
126600
|
function reloadConfigFile() {
|
|
126655
|
-
ts.Debug.assert(configFileName);
|
|
126656
126601
|
writeLog("Reloading config file: ".concat(configFileName));
|
|
126657
126602
|
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
126658
126603
|
if (cachedDirectoryStructureHost) {
|
|
@@ -126667,7 +126612,6 @@ var ts;
|
|
|
126667
126612
|
updateExtendedConfigFilesWatches(toPath(configFileName), compilerOptions, watchOptions, ts.WatchType.ExtendedConfigFile);
|
|
126668
126613
|
}
|
|
126669
126614
|
function parseConfigFile() {
|
|
126670
|
-
ts.Debug.assert(configFileName);
|
|
126671
126615
|
setConfigFileParsingResult(ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost, extendedConfigCache || (extendedConfigCache = new ts.Map()), watchOptionsToExtend, extraFileExtensions)); // TODO: GH#18217
|
|
126672
126616
|
}
|
|
126673
126617
|
function setConfigFileParsingResult(configFileParseResult) {
|
|
@@ -126689,7 +126633,6 @@ var ts;
|
|
|
126689
126633
|
// With host implementing getParsedCommandLine we cant just update file names
|
|
126690
126634
|
if (config.parsedCommandLine && config.reloadLevel === ts.ConfigFileProgramReloadLevel.Partial && !host.getParsedCommandLine) {
|
|
126691
126635
|
writeLog("Reloading new file names and options");
|
|
126692
|
-
ts.Debug.assert(compilerOptions);
|
|
126693
126636
|
var fileNames = ts.getFileNamesFromConfigSpecs(config.parsedCommandLine.options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost);
|
|
126694
126637
|
config.parsedCommandLine = __assign(__assign({}, config.parsedCommandLine), { fileNames: fileNames });
|
|
126695
126638
|
config.reloadLevel = undefined;
|
|
@@ -126776,8 +126719,7 @@ var ts;
|
|
|
126776
126719
|
}
|
|
126777
126720
|
function watchWildcardDirectory(directory, flags) {
|
|
126778
126721
|
return watchDirectory(directory, function (fileOrDirectory) {
|
|
126779
|
-
ts.Debug.assert(configFileName);
|
|
126780
|
-
ts.Debug.assert(compilerOptions);
|
|
126722
|
+
ts.Debug.assert(!!configFileName);
|
|
126781
126723
|
var fileOrDirectoryPath = toPath(fileOrDirectory);
|
|
126782
126724
|
// Since the file existence changed, update the sourceFiles cache
|
|
126783
126725
|
if (cachedDirectoryStructureHost) {
|
|
@@ -126807,7 +126749,6 @@ var ts;
|
|
|
126807
126749
|
}, flags, watchOptions, ts.WatchType.WildcardDirectory);
|
|
126808
126750
|
}
|
|
126809
126751
|
function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions, watchType) {
|
|
126810
|
-
ts.Debug.assert(configFileName);
|
|
126811
126752
|
ts.updateSharedExtendedConfigFileWatcher(forProjectPath, options, sharedExtendedConfigFileWatchers || (sharedExtendedConfigFileWatchers = new ts.Map()), function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(extendedConfigFileName, function (_fileName, eventKind) {
|
|
126812
126753
|
var _a;
|
|
126813
126754
|
updateCachedSystemWithFile(extendedConfigFileName, extendedConfigFilePath, eventKind);
|
|
@@ -131950,6 +131891,12 @@ var ts;
|
|
|
131950
131891
|
}
|
|
131951
131892
|
ts.getSynthesizedDeepCloneWithReplacements = getSynthesizedDeepCloneWithReplacements;
|
|
131952
131893
|
function getSynthesizedDeepCloneWorker(node, replaceNode) {
|
|
131894
|
+
var nodeClone = replaceNode
|
|
131895
|
+
? function (n) { return getSynthesizedDeepCloneWithReplacements(n, /*includeTrivia*/ true, replaceNode); }
|
|
131896
|
+
: getSynthesizedDeepClone;
|
|
131897
|
+
var nodesClone = replaceNode
|
|
131898
|
+
? function (ns) { return ns && getSynthesizedDeepClonesWithReplacements(ns, /*includeTrivia*/ true, replaceNode); }
|
|
131899
|
+
: function (ns) { return ns && getSynthesizedDeepClones(ns); };
|
|
131953
131900
|
var visited = ts.visitEachChild(node, nodeClone, ts.nullTransformationContext, nodesClone, nodeClone);
|
|
131954
131901
|
if (visited === node) {
|
|
131955
131902
|
// This only happens for leaf nodes - internal nodes always see their children change.
|
|
@@ -131963,16 +131910,6 @@ var ts;
|
|
|
131963
131910
|
// would have made.
|
|
131964
131911
|
visited.parent = undefined;
|
|
131965
131912
|
return visited;
|
|
131966
|
-
function nodeClone(node) {
|
|
131967
|
-
return replaceNode
|
|
131968
|
-
? getSynthesizedDeepCloneWithReplacements(node, /*includeTrivia*/ true, replaceNode)
|
|
131969
|
-
: getSynthesizedDeepClone(node);
|
|
131970
|
-
}
|
|
131971
|
-
function nodesClone(nodes) {
|
|
131972
|
-
return replaceNode
|
|
131973
|
-
? nodes && getSynthesizedDeepClonesWithReplacements(nodes, /*includeTrivia*/ true, replaceNode)
|
|
131974
|
-
: nodes && getSynthesizedDeepClones(nodes);
|
|
131975
|
-
}
|
|
131976
131913
|
}
|
|
131977
131914
|
function getSynthesizedDeepClones(nodes, includeTrivia) {
|
|
131978
131915
|
if (includeTrivia === void 0) { includeTrivia = true; }
|
|
@@ -132712,7 +132649,7 @@ var ts;
|
|
|
132712
132649
|
return false;
|
|
132713
132650
|
}
|
|
132714
132651
|
// If the file is a module written in TypeScript, it still might be in a `declare global` augmentation
|
|
132715
|
-
return ts.isInJSFile(declaration) || !ts.findAncestor(declaration,
|
|
132652
|
+
return ts.isInJSFile(declaration) || !ts.findAncestor(declaration, ts.isGlobalScopeAugmentation);
|
|
132716
132653
|
}
|
|
132717
132654
|
ts.isNonGlobalDeclaration = isNonGlobalDeclaration;
|
|
132718
132655
|
function isDeprecatedDeclaration(decl) {
|
|
@@ -135195,7 +135132,7 @@ var ts;
|
|
|
135195
135132
|
if (!dependencies)
|
|
135196
135133
|
continue;
|
|
135197
135134
|
for (var dep in dependencies) {
|
|
135198
|
-
if (
|
|
135135
|
+
if (ts.hasProperty(dependencies, dep) && !ts.startsWith(dep, "@types/")) {
|
|
135199
135136
|
result.push(dep);
|
|
135200
135137
|
}
|
|
135201
135138
|
}
|
|
@@ -135579,7 +135516,7 @@ var ts;
|
|
|
135579
135516
|
return (location === null || location === void 0 ? void 0 : location.kind) === 79 /* SyntaxKind.Identifier */ ? ts.createTextSpanFromNode(location) : undefined;
|
|
135580
135517
|
}
|
|
135581
135518
|
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) {
|
|
135582
|
-
var symbols = completionData.symbols, contextToken = completionData.contextToken, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation, isJsxIdentifierExpected = completionData.isJsxIdentifierExpected, isRightOfOpenTag = completionData.isRightOfOpenTag,
|
|
135519
|
+
var symbols = completionData.symbols, contextToken = completionData.contextToken, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation, isJsxIdentifierExpected = completionData.isJsxIdentifierExpected, isRightOfOpenTag = completionData.isRightOfOpenTag, importStatementCompletion = completionData.importStatementCompletion, insideJsDocTagTypeExpression = completionData.insideJsDocTagTypeExpression, symbolToSortTextMap = completionData.symbolToSortTextMap, hasUnresolvedAutoImports = completionData.hasUnresolvedAutoImports;
|
|
135583
135520
|
// Verify if the file is JSX language variant
|
|
135584
135521
|
if (ts.getLanguageVariant(sourceFile.scriptKind) === 1 /* LanguageVariant.JSX */) {
|
|
135585
135522
|
var completionInfo = getJsxClosingTagCompletion(location, sourceFile);
|
|
@@ -135593,7 +135530,7 @@ var ts;
|
|
|
135593
135530
|
return undefined;
|
|
135594
135531
|
}
|
|
135595
135532
|
var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries,
|
|
135596
|
-
/*replacementToken*/ undefined, contextToken, location, sourceFile, host, program, ts.getEmitScriptTarget(compilerOptions), log, completionKind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, isJsxIdentifierExpected, isJsxInitializer,
|
|
135533
|
+
/*replacementToken*/ undefined, contextToken, location, sourceFile, host, program, ts.getEmitScriptTarget(compilerOptions), log, completionKind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, isJsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag);
|
|
135597
135534
|
if (keywordFilters !== 0 /* KeywordCompletionFilters.None */) {
|
|
135598
135535
|
for (var _i = 0, _a = getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && ts.isSourceFileJS(sourceFile)); _i < _a.length; _i++) {
|
|
135599
135536
|
var keywordEntry = _a[_i];
|
|
@@ -135711,7 +135648,7 @@ var ts;
|
|
|
135711
135648
|
function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
135712
135649
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* ScriptElementKind.string */, kindModifiers: "" /* ScriptElementKindModifier.none */, sortText: Completions.SortText.LocationPriority };
|
|
135713
135650
|
}
|
|
135714
|
-
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer,
|
|
135651
|
+
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) {
|
|
135715
135652
|
var _a, _b;
|
|
135716
135653
|
var insertText;
|
|
135717
135654
|
var replacementSpan = ts.getReplacementSpanForContextToken(replacementToken);
|
|
@@ -135767,8 +135704,8 @@ var ts;
|
|
|
135767
135704
|
}
|
|
135768
135705
|
if (originIsResolvedExport(origin)) {
|
|
135769
135706
|
sourceDisplay = [ts.textPart(origin.moduleSpecifier)];
|
|
135770
|
-
if (
|
|
135771
|
-
(_a = getInsertTextAndReplacementSpanForImportCompletion(name,
|
|
135707
|
+
if (importStatementCompletion) {
|
|
135708
|
+
(_a = getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences), insertText = _a.insertText, replacementSpan = _a.replacementSpan);
|
|
135772
135709
|
isSnippet = preferences.includeCompletionsWithSnippetText ? true : undefined;
|
|
135773
135710
|
}
|
|
135774
135711
|
}
|
|
@@ -135823,7 +135760,7 @@ var ts;
|
|
|
135823
135760
|
}
|
|
135824
135761
|
if (originIsExport(origin) || originIsResolvedExport(origin)) {
|
|
135825
135762
|
data = originToCompletionEntryData(origin);
|
|
135826
|
-
hasAction = !
|
|
135763
|
+
hasAction = !importStatementCompletion;
|
|
135827
135764
|
}
|
|
135828
135765
|
// TODO(drosen): Right now we just permit *all* semantic meanings when calling
|
|
135829
135766
|
// 'getSymbolKind' which is permissible given that it is backwards compatible; but
|
|
@@ -135846,7 +135783,7 @@ var ts;
|
|
|
135846
135783
|
labelDetails: labelDetails,
|
|
135847
135784
|
isSnippet: isSnippet,
|
|
135848
135785
|
isPackageJsonImport: originIsPackageJsonImport(origin) || undefined,
|
|
135849
|
-
isImportStatementCompletion: !!
|
|
135786
|
+
isImportStatementCompletion: !!importStatementCompletion || undefined,
|
|
135850
135787
|
data: data,
|
|
135851
135788
|
};
|
|
135852
135789
|
}
|
|
@@ -136048,7 +135985,6 @@ var ts;
|
|
|
136048
135985
|
var labelDetails = { detail: signaturePrinter.printNode(4 /* EmitHint.Unspecified */, methodSignature, sourceFile) };
|
|
136049
135986
|
return { isSnippet: isSnippet, insertText: insertText, labelDetails: labelDetails };
|
|
136050
135987
|
}
|
|
136051
|
-
;
|
|
136052
135988
|
function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences) {
|
|
136053
135989
|
var declarations = symbol.getDeclarations();
|
|
136054
135990
|
if (!(declarations && declarations.length)) {
|
|
@@ -136219,19 +136155,16 @@ var ts;
|
|
|
136219
136155
|
};
|
|
136220
136156
|
return unresolvedOrigin;
|
|
136221
136157
|
}
|
|
136222
|
-
function getInsertTextAndReplacementSpanForImportCompletion(name,
|
|
136223
|
-
var
|
|
136224
|
-
var sourceFile = importCompletionNode.getSourceFile();
|
|
136225
|
-
var replacementSpan = ts.createTextSpanFromNode(ts.findAncestor(importCompletionNode, ts.or(ts.isImportDeclaration, ts.isImportEqualsDeclaration)) || importCompletionNode, sourceFile);
|
|
136158
|
+
function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) {
|
|
136159
|
+
var replacementSpan = importStatementCompletion.replacementSpan;
|
|
136226
136160
|
var quotedModuleSpecifier = ts.quote(sourceFile, preferences, origin.moduleSpecifier);
|
|
136227
136161
|
var exportKind = origin.isDefaultExport ? 1 /* ExportKind.Default */ :
|
|
136228
136162
|
origin.exportName === "export=" /* InternalSymbolName.ExportEquals */ ? 2 /* ExportKind.ExportEquals */ :
|
|
136229
136163
|
0 /* ExportKind.Named */;
|
|
136230
136164
|
var tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : "";
|
|
136231
136165
|
var importKind = ts.codefix.getImportKind(sourceFile, exportKind, options, /*forceImportKeyword*/ true);
|
|
136232
|
-
var
|
|
136233
|
-
var
|
|
136234
|
-
var topLevelTypeOnlyText = isTopLevelTypeOnly ? " ".concat(ts.tokenToString(154 /* SyntaxKind.TypeKeyword */), " ") : " ";
|
|
136166
|
+
var isImportSpecifierTypeOnly = importStatementCompletion.couldBeTypeOnlyImportSpecifier;
|
|
136167
|
+
var topLevelTypeOnlyText = importStatementCompletion.isTopLevelTypeOnly ? " ".concat(ts.tokenToString(154 /* SyntaxKind.TypeKeyword */), " ") : " ";
|
|
136235
136168
|
var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? "".concat(ts.tokenToString(154 /* SyntaxKind.TypeKeyword */), " ") : "";
|
|
136236
136169
|
var suffix = useSemicolons ? ";" : "";
|
|
136237
136170
|
switch (importKind) {
|
|
@@ -136265,7 +136198,7 @@ var ts;
|
|
|
136265
136198
|
return CompletionSource.TypeOnlyAlias;
|
|
136266
136199
|
}
|
|
136267
136200
|
}
|
|
136268
|
-
function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer,
|
|
136201
|
+
function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) {
|
|
136269
136202
|
var _a;
|
|
136270
136203
|
var start = ts.timestamp();
|
|
136271
136204
|
var variableDeclaration = getVariableDeclaration(location);
|
|
@@ -136286,7 +136219,7 @@ var ts;
|
|
|
136286
136219
|
var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess;
|
|
136287
136220
|
var originalSortText = (_a = symbolToSortTextMap === null || symbolToSortTextMap === void 0 ? void 0 : symbolToSortTextMap[ts.getSymbolId(symbol)]) !== null && _a !== void 0 ? _a : Completions.SortText.LocationPriority;
|
|
136288
136221
|
var sortText = (isDeprecated(symbol, typeChecker) ? Completions.SortText.Deprecated(originalSortText) : originalSortText);
|
|
136289
|
-
var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer,
|
|
136222
|
+
var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, compilerOptions, preferences, kind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag);
|
|
136290
136223
|
if (!entry) {
|
|
136291
136224
|
continue;
|
|
136292
136225
|
}
|
|
@@ -136477,7 +136410,7 @@ var ts;
|
|
|
136477
136410
|
Completions.createCompletionDetails = createCompletionDetails;
|
|
136478
136411
|
function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences, data, source, cancellationToken) {
|
|
136479
136412
|
if (data === null || data === void 0 ? void 0 : data.moduleSpecifier) {
|
|
136480
|
-
if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken).
|
|
136413
|
+
if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken).replacementSpan) {
|
|
136481
136414
|
// Import statement completion: 'import c|'
|
|
136482
136415
|
return { codeActions: undefined, sourceDisplay: [ts.textPart(data.moduleSpecifier)] };
|
|
136483
136416
|
}
|
|
@@ -136678,34 +136611,34 @@ var ts;
|
|
|
136678
136611
|
var isStartingCloseTag = false;
|
|
136679
136612
|
var isJsxInitializer = false;
|
|
136680
136613
|
var isJsxIdentifierExpected = false;
|
|
136681
|
-
var
|
|
136614
|
+
var importStatementCompletion;
|
|
136682
136615
|
var location = ts.getTouchingPropertyName(sourceFile, position);
|
|
136683
136616
|
var keywordFilters = 0 /* KeywordCompletionFilters.None */;
|
|
136684
136617
|
var isNewIdentifierLocation = false;
|
|
136685
136618
|
var flags = 0 /* CompletionInfoFlags.None */;
|
|
136686
136619
|
if (contextToken) {
|
|
136687
|
-
var
|
|
136688
|
-
|
|
136689
|
-
|
|
136690
|
-
if (importStatementCompletion.isKeywordOnlyCompletion) {
|
|
136620
|
+
var importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken);
|
|
136621
|
+
if (importStatementCompletionInfo.keywordCompletion) {
|
|
136622
|
+
if (importStatementCompletionInfo.isKeywordOnlyCompletion) {
|
|
136691
136623
|
return {
|
|
136692
136624
|
kind: 4 /* CompletionDataKind.Keywords */,
|
|
136693
|
-
keywordCompletions: [keywordToCompletionEntry(
|
|
136694
|
-
isNewIdentifierLocation: isNewIdentifierLocation,
|
|
136625
|
+
keywordCompletions: [keywordToCompletionEntry(importStatementCompletionInfo.keywordCompletion)],
|
|
136626
|
+
isNewIdentifierLocation: importStatementCompletionInfo.isNewIdentifierLocation,
|
|
136695
136627
|
};
|
|
136696
136628
|
}
|
|
136697
|
-
keywordFilters = keywordFiltersFromSyntaxKind(
|
|
136629
|
+
keywordFilters = keywordFiltersFromSyntaxKind(importStatementCompletionInfo.keywordCompletion);
|
|
136698
136630
|
}
|
|
136699
|
-
if (
|
|
136631
|
+
if (importStatementCompletionInfo.replacementSpan && preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) {
|
|
136700
136632
|
// Import statement completions use `insertText`, and also require the `data` property of `CompletionEntryIdentifier`
|
|
136701
136633
|
// added in TypeScript 4.3 to be sent back from the client during `getCompletionEntryDetails`. Since this feature
|
|
136702
136634
|
// is not backward compatible with older clients, the language service defaults to disabling it, allowing newer clients
|
|
136703
136635
|
// to opt in with the `includeCompletionsForImportStatements` user preference.
|
|
136704
|
-
importCompletionNode = importStatementCompletion.replacementNode;
|
|
136705
136636
|
flags |= 2 /* CompletionInfoFlags.IsImportStatementCompletion */;
|
|
136637
|
+
importStatementCompletion = importStatementCompletionInfo;
|
|
136638
|
+
isNewIdentifierLocation = importStatementCompletionInfo.isNewIdentifierLocation;
|
|
136706
136639
|
}
|
|
136707
136640
|
// Bail out if this is a known invalid completion location
|
|
136708
|
-
if (!
|
|
136641
|
+
if (!importStatementCompletionInfo.replacementSpan && isCompletionListBlocker(contextToken)) {
|
|
136709
136642
|
log("Returning an empty list because completion was requested in an invalid position.");
|
|
136710
136643
|
return keywordFilters
|
|
136711
136644
|
? keywordCompletionData(keywordFilters, isJsOnlyLocation, isNewIdentifierDefinitionLocation())
|
|
@@ -136751,7 +136684,7 @@ var ts;
|
|
|
136751
136684
|
return undefined;
|
|
136752
136685
|
}
|
|
136753
136686
|
}
|
|
136754
|
-
else if (!
|
|
136687
|
+
else if (!importStatementCompletion) {
|
|
136755
136688
|
// <UI.Test /* completion position */ />
|
|
136756
136689
|
// If the tagname is a property access expression, we will then walk up to the top most of property access expression.
|
|
136757
136690
|
// Then, try to get a JSX container and its associated attributes type.
|
|
@@ -136894,7 +136827,7 @@ var ts;
|
|
|
136894
136827
|
isTypeOnlyLocation: isTypeOnlyLocation,
|
|
136895
136828
|
isJsxIdentifierExpected: isJsxIdentifierExpected,
|
|
136896
136829
|
isRightOfOpenTag: isRightOfOpenTag,
|
|
136897
|
-
|
|
136830
|
+
importStatementCompletion: importStatementCompletion,
|
|
136898
136831
|
hasUnresolvedAutoImports: hasUnresolvedAutoImports,
|
|
136899
136832
|
flags: flags,
|
|
136900
136833
|
};
|
|
@@ -137148,7 +137081,7 @@ var ts;
|
|
|
137148
137081
|
return 1 /* GlobalsSearch.Success */;
|
|
137149
137082
|
}
|
|
137150
137083
|
function tryGetImportCompletionSymbols() {
|
|
137151
|
-
if (!
|
|
137084
|
+
if (!importStatementCompletion)
|
|
137152
137085
|
return 0 /* GlobalsSearch.Continue */;
|
|
137153
137086
|
isNewIdentifierLocation = true;
|
|
137154
137087
|
collectAutoImports();
|
|
@@ -137231,7 +137164,7 @@ var ts;
|
|
|
137231
137164
|
}
|
|
137232
137165
|
function shouldOfferImportCompletions() {
|
|
137233
137166
|
// If already typing an import statement, provide completions for it.
|
|
137234
|
-
if (
|
|
137167
|
+
if (importStatementCompletion)
|
|
137235
137168
|
return true;
|
|
137236
137169
|
// If current completion is for non-contextual Object literal shortahands, ignore auto-import symbols
|
|
137237
137170
|
if (isNonContextualObjectLiteral)
|
|
@@ -137261,7 +137194,7 @@ var ts;
|
|
|
137261
137194
|
}
|
|
137262
137195
|
function isTypeOnlyCompletion() {
|
|
137263
137196
|
return insideJsDocTagTypeExpression
|
|
137264
|
-
|| !!
|
|
137197
|
+
|| !!importStatementCompletion && ts.isTypeOnlyImportOrExportDeclaration(location.parent)
|
|
137265
137198
|
|| !isContextTokenValueLocation(contextToken) &&
|
|
137266
137199
|
(ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker)
|
|
137267
137200
|
|| ts.isPartOfTypeNode(location)
|
|
@@ -137311,8 +137244,7 @@ var ts;
|
|
|
137311
137244
|
flags |= 1 /* CompletionInfoFlags.MayIncludeAutoImports */;
|
|
137312
137245
|
// import { type | -> token text should be blank
|
|
137313
137246
|
var isAfterTypeOnlyImportSpecifierModifier = previousToken === contextToken
|
|
137314
|
-
&&
|
|
137315
|
-
&& couldBeTypeOnlyImportSpecifier(importCompletionNode, contextToken);
|
|
137247
|
+
&& importStatementCompletion;
|
|
137316
137248
|
var lowerCaseTokenText = isAfterTypeOnlyImportSpecifierModifier ? "" :
|
|
137317
137249
|
previousToken && ts.isIdentifier(previousToken) ? previousToken.text.toLowerCase() :
|
|
137318
137250
|
"";
|
|
@@ -137320,14 +137252,14 @@ var ts;
|
|
|
137320
137252
|
var exportInfo = ts.getExportInfoMap(sourceFile, host, program, preferences, cancellationToken);
|
|
137321
137253
|
var packageJsonAutoImportProvider = (_b = host.getPackageJsonAutoImportProvider) === null || _b === void 0 ? void 0 : _b.call(host);
|
|
137322
137254
|
var packageJsonFilter = detailsEntryId ? undefined : ts.createPackageJsonImportFilter(sourceFile, preferences, host);
|
|
137323
|
-
resolvingModuleSpecifiers("collectAutoImports", host, importSpecifierResolver || (importSpecifierResolver = ts.codefix.createImportSpecifierResolver(sourceFile, program, host, preferences)), program, position, preferences, !!
|
|
137255
|
+
resolvingModuleSpecifiers("collectAutoImports", host, importSpecifierResolver || (importSpecifierResolver = ts.codefix.createImportSpecifierResolver(sourceFile, program, host, preferences)), program, position, preferences, !!importStatementCompletion, ts.isValidTypeOnlyAliasUseSite(location), function (context) {
|
|
137324
137256
|
exportInfo.search(sourceFile.path,
|
|
137325
137257
|
/*preferCapitalized*/ isRightOfOpenTag, function (symbolName, targetFlags) {
|
|
137326
137258
|
if (!ts.isIdentifierText(symbolName, ts.getEmitScriptTarget(host.getCompilationSettings())))
|
|
137327
137259
|
return false;
|
|
137328
137260
|
if (!detailsEntryId && ts.isStringANonContextualKeyword(symbolName))
|
|
137329
137261
|
return false;
|
|
137330
|
-
if (!isTypeOnlyLocation && !
|
|
137262
|
+
if (!isTypeOnlyLocation && !importStatementCompletion && !(targetFlags & 111551 /* SymbolFlags.Value */))
|
|
137331
137263
|
return false;
|
|
137332
137264
|
if (isTypeOnlyLocation && !(targetFlags & (1536 /* SymbolFlags.Module */ | 788968 /* SymbolFlags.Type */)))
|
|
137333
137265
|
return false;
|
|
@@ -137408,7 +137340,7 @@ var ts;
|
|
|
137408
137340
|
return;
|
|
137409
137341
|
}
|
|
137410
137342
|
symbolToOriginInfoMap[symbols.length] = origin;
|
|
137411
|
-
symbolToSortTextMap[symbolId] =
|
|
137343
|
+
symbolToSortTextMap[symbolId] = importStatementCompletion ? Completions.SortText.LocationPriority : Completions.SortText.AutoImportSuggestions;
|
|
137412
137344
|
symbols.push(symbol);
|
|
137413
137345
|
}
|
|
137414
137346
|
/* Mutates `symbols` and `symbolToOriginInfoMap`. */
|
|
@@ -138675,6 +138607,7 @@ var ts;
|
|
|
138675
138607
|
return undefined;
|
|
138676
138608
|
}
|
|
138677
138609
|
function getImportStatementCompletionInfo(contextToken) {
|
|
138610
|
+
var _a, _b, _c;
|
|
138678
138611
|
var keywordCompletion;
|
|
138679
138612
|
var isKeywordOnlyCompletion = false;
|
|
138680
138613
|
var candidate = getCandidate();
|
|
@@ -138682,9 +138615,9 @@ var ts;
|
|
|
138682
138615
|
isKeywordOnlyCompletion: isKeywordOnlyCompletion,
|
|
138683
138616
|
keywordCompletion: keywordCompletion,
|
|
138684
138617
|
isNewIdentifierLocation: !!(candidate || keywordCompletion === 154 /* SyntaxKind.TypeKeyword */),
|
|
138685
|
-
|
|
138686
|
-
|
|
138687
|
-
|
|
138618
|
+
isTopLevelTypeOnly: !!((_b = (_a = ts.tryCast(candidate, ts.isImportDeclaration)) === null || _a === void 0 ? void 0 : _a.importClause) === null || _b === void 0 ? void 0 : _b.isTypeOnly) || !!((_c = ts.tryCast(candidate, ts.isImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.isTypeOnly),
|
|
138619
|
+
couldBeTypeOnlyImportSpecifier: !!candidate && couldBeTypeOnlyImportSpecifier(candidate, contextToken),
|
|
138620
|
+
replacementSpan: getSingleLineReplacementSpanForImportCompletionNode(candidate),
|
|
138688
138621
|
};
|
|
138689
138622
|
function getCandidate() {
|
|
138690
138623
|
var parent = contextToken.parent;
|
|
@@ -138726,14 +138659,71 @@ var ts;
|
|
|
138726
138659
|
return undefined;
|
|
138727
138660
|
}
|
|
138728
138661
|
}
|
|
138662
|
+
function getSingleLineReplacementSpanForImportCompletionNode(node) {
|
|
138663
|
+
var _a, _b, _c;
|
|
138664
|
+
if (!node)
|
|
138665
|
+
return undefined;
|
|
138666
|
+
var top = (_a = ts.findAncestor(node, ts.or(ts.isImportDeclaration, ts.isImportEqualsDeclaration))) !== null && _a !== void 0 ? _a : node;
|
|
138667
|
+
var sourceFile = top.getSourceFile();
|
|
138668
|
+
if (ts.rangeIsOnSingleLine(top, sourceFile)) {
|
|
138669
|
+
return ts.createTextSpanFromNode(top, sourceFile);
|
|
138670
|
+
}
|
|
138671
|
+
// ImportKeyword was necessarily on one line; ImportSpecifier was necessarily parented in an ImportDeclaration
|
|
138672
|
+
ts.Debug.assert(top.kind !== 100 /* SyntaxKind.ImportKeyword */ && top.kind !== 273 /* SyntaxKind.ImportSpecifier */);
|
|
138673
|
+
// Guess which point in the import might actually be a later statement parsed as part of the import
|
|
138674
|
+
// during parser recovery - either in the middle of named imports, or the module specifier.
|
|
138675
|
+
var potentialSplitPoint = top.kind === 269 /* SyntaxKind.ImportDeclaration */
|
|
138676
|
+
? (_c = getPotentiallyInvalidImportSpecifier((_b = top.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings)) !== null && _c !== void 0 ? _c : top.moduleSpecifier
|
|
138677
|
+
: top.moduleReference;
|
|
138678
|
+
var withoutModuleSpecifier = {
|
|
138679
|
+
pos: top.getFirstToken().getStart(),
|
|
138680
|
+
end: potentialSplitPoint.pos,
|
|
138681
|
+
};
|
|
138682
|
+
// The module specifier/reference was previously found to be missing, empty, or
|
|
138683
|
+
// not a string literal - in this last case, it's likely that statement on a following
|
|
138684
|
+
// line was parsed as the module specifier of a partially-typed import, e.g.
|
|
138685
|
+
// import Foo|
|
|
138686
|
+
// interface Blah {}
|
|
138687
|
+
// This appears to be a multiline-import, and editors can't replace multiple lines.
|
|
138688
|
+
// But if everything but the "module specifier" is on one line, by this point we can
|
|
138689
|
+
// assume that the "module specifier" is actually just another statement, and return
|
|
138690
|
+
// the single-line range of the import excluding that probable statement.
|
|
138691
|
+
if (ts.rangeIsOnSingleLine(withoutModuleSpecifier, sourceFile)) {
|
|
138692
|
+
return ts.createTextSpanFromRange(withoutModuleSpecifier);
|
|
138693
|
+
}
|
|
138694
|
+
}
|
|
138695
|
+
// Tries to identify the first named import that is not really a named import, but rather
|
|
138696
|
+
// just parser recovery for a situation like:
|
|
138697
|
+
// import { Foo|
|
|
138698
|
+
// interface Bar {}
|
|
138699
|
+
// in which `Foo`, `interface`, and `Bar` are all parsed as import specifiers. The caller
|
|
138700
|
+
// will also check if this token is on a separate line from the rest of the import.
|
|
138701
|
+
function getPotentiallyInvalidImportSpecifier(namedBindings) {
|
|
138702
|
+
var _a;
|
|
138703
|
+
return ts.find((_a = ts.tryCast(namedBindings, ts.isNamedImports)) === null || _a === void 0 ? void 0 : _a.elements, function (e) {
|
|
138704
|
+
var _a;
|
|
138705
|
+
return !e.propertyName &&
|
|
138706
|
+
ts.isStringANonContextualKeyword(e.name.text) &&
|
|
138707
|
+
((_a = ts.findPrecedingToken(e.name.pos, namedBindings.getSourceFile(), namedBindings)) === null || _a === void 0 ? void 0 : _a.kind) !== 27 /* SyntaxKind.CommaToken */;
|
|
138708
|
+
});
|
|
138709
|
+
}
|
|
138729
138710
|
function couldBeTypeOnlyImportSpecifier(importSpecifier, contextToken) {
|
|
138730
138711
|
return ts.isImportSpecifier(importSpecifier)
|
|
138731
138712
|
&& (importSpecifier.isTypeOnly || contextToken === importSpecifier.name && ts.isTypeKeywordTokenOrIdentifier(contextToken));
|
|
138732
138713
|
}
|
|
138733
138714
|
function canCompleteFromNamedBindings(namedBindings) {
|
|
138734
|
-
|
|
138735
|
-
|
|
138736
|
-
|
|
138715
|
+
if (!isModuleSpecifierMissingOrEmpty(namedBindings.parent.parent.moduleSpecifier) || namedBindings.parent.name) {
|
|
138716
|
+
return false;
|
|
138717
|
+
}
|
|
138718
|
+
if (ts.isNamedImports(namedBindings)) {
|
|
138719
|
+
// We can only complete on named imports if there are no other named imports already,
|
|
138720
|
+
// but parser recovery sometimes puts later statements in the named imports list, so
|
|
138721
|
+
// we try to only consider the probably-valid ones.
|
|
138722
|
+
var invalidNamedImport = getPotentiallyInvalidImportSpecifier(namedBindings);
|
|
138723
|
+
var validImports = invalidNamedImport ? namedBindings.elements.indexOf(invalidNamedImport) : namedBindings.elements.length;
|
|
138724
|
+
return validImports < 2;
|
|
138725
|
+
}
|
|
138726
|
+
return true;
|
|
138737
138727
|
}
|
|
138738
138728
|
function isModuleSpecifierMissingOrEmpty(specifier) {
|
|
138739
138729
|
var _a;
|
|
@@ -138752,7 +138742,6 @@ var ts;
|
|
|
138752
138742
|
function isArrowFunctionBody(node) {
|
|
138753
138743
|
return node.parent && ts.isArrowFunction(node.parent) && node.parent.body === node;
|
|
138754
138744
|
}
|
|
138755
|
-
;
|
|
138756
138745
|
/** True if symbol is a type or a module containing at least one type. */
|
|
138757
138746
|
function symbolCanBeReferencedAtTypeLocation(symbol, checker, seenModules) {
|
|
138758
138747
|
if (seenModules === void 0) { seenModules = new ts.Map(); }
|
|
@@ -139036,7 +139025,7 @@ var ts;
|
|
|
139036
139025
|
// If we're an accessibility modifier, we're in an instance member and should search
|
|
139037
139026
|
// the constructor's parameter list for instance members as well.
|
|
139038
139027
|
if (modifierFlag & (28 /* ModifierFlags.AccessibilityModifier */ | 64 /* ModifierFlags.Readonly */)) {
|
|
139039
|
-
var constructor = ts.find(container.members, ts.isConstructorDeclaration);
|
|
139028
|
+
var constructor = ts.find(container.members, ts.isConstructorDeclaration);
|
|
139040
139029
|
if (constructor) {
|
|
139041
139030
|
return __spreadArray(__spreadArray([], nodes, true), constructor.parameters, true);
|
|
139042
139031
|
}
|
|
@@ -146769,6 +146758,10 @@ var ts;
|
|
|
146769
146758
|
pushSelectionCommentRange(comment.pos, comment.end);
|
|
146770
146759
|
}
|
|
146771
146760
|
if (positionShouldSnapToNode(sourceFile, pos, node)) {
|
|
146761
|
+
if (ts.isFunctionBody(node)
|
|
146762
|
+
&& ts.isFunctionLikeDeclaration(parentNode) && !ts.positionsAreOnSameLine(node.getStart(sourceFile), node.getEnd(), sourceFile)) {
|
|
146763
|
+
pushSelectionRange(node.getStart(sourceFile), node.getEnd());
|
|
146764
|
+
}
|
|
146772
146765
|
// 1. Blocks are effectively redundant with SyntaxLists.
|
|
146773
146766
|
// 2. TemplateSpans, along with the SyntaxLists containing them, are a somewhat unintuitive grouping
|
|
146774
146767
|
// of things that should be considered independently.
|
|
@@ -147920,7 +147913,7 @@ var ts;
|
|
|
147920
147913
|
return name === "undefined";
|
|
147921
147914
|
}
|
|
147922
147915
|
function isHintableDeclaration(node) {
|
|
147923
|
-
if ((ts.
|
|
147916
|
+
if ((ts.isParameterDeclaration(node) || ts.isVariableDeclaration(node) && ts.isVarConst(node)) && node.initializer) {
|
|
147924
147917
|
var initializer = ts.skipParentheses(node.initializer);
|
|
147925
147918
|
return !(isHintableLiteral(initializer) || ts.isNewExpression(initializer) || ts.isObjectLiteralExpression(initializer) || ts.isAssertionExpression(initializer));
|
|
147926
147919
|
}
|
|
@@ -149833,19 +149826,19 @@ var ts;
|
|
|
149833
149826
|
return function (context) { return context.options && context.options[optionName] === optionValue; };
|
|
149834
149827
|
}
|
|
149835
149828
|
function isOptionEnabled(optionName) {
|
|
149836
|
-
return function (context) { return context.options && context.options
|
|
149829
|
+
return function (context) { return context.options && ts.hasProperty(context.options, optionName) && !!context.options[optionName]; };
|
|
149837
149830
|
}
|
|
149838
149831
|
function isOptionDisabled(optionName) {
|
|
149839
|
-
return function (context) { return context.options && context.options
|
|
149832
|
+
return function (context) { return context.options && ts.hasProperty(context.options, optionName) && !context.options[optionName]; };
|
|
149840
149833
|
}
|
|
149841
149834
|
function isOptionDisabledOrUndefined(optionName) {
|
|
149842
|
-
return function (context) { return !context.options || !context.options
|
|
149835
|
+
return function (context) { return !context.options || !ts.hasProperty(context.options, optionName) || !context.options[optionName]; };
|
|
149843
149836
|
}
|
|
149844
149837
|
function isOptionDisabledOrUndefinedOrTokensOnSameLine(optionName) {
|
|
149845
|
-
return function (context) { return !context.options || !context.options
|
|
149838
|
+
return function (context) { return !context.options || !ts.hasProperty(context.options, optionName) || !context.options[optionName] || context.TokensAreOnSameLine(); };
|
|
149846
149839
|
}
|
|
149847
149840
|
function isOptionEnabledOrUndefined(optionName) {
|
|
149848
|
-
return function (context) { return !context.options || !context.options
|
|
149841
|
+
return function (context) { return !context.options || !ts.hasProperty(context.options, optionName) || !!context.options[optionName]; };
|
|
149849
149842
|
}
|
|
149850
149843
|
function isForContext(context) {
|
|
149851
149844
|
return context.contextNode.kind === 245 /* SyntaxKind.ForStatement */;
|
|
@@ -153161,7 +153154,6 @@ var ts;
|
|
|
153161
153154
|
if (!visited) {
|
|
153162
153155
|
return visited;
|
|
153163
153156
|
}
|
|
153164
|
-
ts.Debug.assert(nodes);
|
|
153165
153157
|
// clone nodearray if necessary
|
|
153166
153158
|
var nodeArray = visited === nodes ? ts.factory.createNodeArray(visited.slice(0)) : visited;
|
|
153167
153159
|
ts.setTextRangePosEnd(nodeArray, getPos(nodes), getEnd(nodes));
|
|
@@ -154450,31 +154442,22 @@ var ts;
|
|
|
154450
154442
|
var param = _a[_i];
|
|
154451
154443
|
if (!param.type) {
|
|
154452
154444
|
var paramType = ts.getJSDocType(param);
|
|
154453
|
-
if (paramType)
|
|
154454
|
-
|
|
154455
|
-
ts.Debug.assertNode(transformedType, ts.isTypeNode);
|
|
154456
|
-
changes.tryInsertTypeAnnotation(sourceFile, param, transformedType);
|
|
154457
|
-
}
|
|
154445
|
+
if (paramType)
|
|
154446
|
+
changes.tryInsertTypeAnnotation(sourceFile, param, transformJSDocType(paramType));
|
|
154458
154447
|
}
|
|
154459
154448
|
}
|
|
154460
154449
|
if (needParens)
|
|
154461
154450
|
changes.insertNodeAfter(sourceFile, ts.last(decl.parameters), ts.factory.createToken(21 /* SyntaxKind.CloseParenToken */));
|
|
154462
154451
|
if (!decl.type) {
|
|
154463
154452
|
var returnType = ts.getJSDocReturnType(decl);
|
|
154464
|
-
if (returnType)
|
|
154465
|
-
|
|
154466
|
-
ts.Debug.assertNode(transformedType, ts.isTypeNode);
|
|
154467
|
-
changes.tryInsertTypeAnnotation(sourceFile, decl, transformedType);
|
|
154468
|
-
}
|
|
154469
|
-
;
|
|
154453
|
+
if (returnType)
|
|
154454
|
+
changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(returnType));
|
|
154470
154455
|
}
|
|
154471
154456
|
}
|
|
154472
154457
|
else {
|
|
154473
154458
|
var jsdocType = ts.Debug.checkDefined(ts.getJSDocType(decl), "A JSDocType for this declaration should exist"); // If not defined, shouldn't have been an error to fix
|
|
154474
154459
|
ts.Debug.assert(!decl.type, "The JSDocType decl should have a type"); // If defined, shouldn't have been an error to fix.
|
|
154475
|
-
|
|
154476
|
-
ts.Debug.assertNode(transformedType, ts.isTypeNode);
|
|
154477
|
-
changes.tryInsertTypeAnnotation(sourceFile, decl, transformedType);
|
|
154460
|
+
changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(jsdocType));
|
|
154478
154461
|
}
|
|
154479
154462
|
}
|
|
154480
154463
|
function isDeclarationWithType(node) {
|
|
@@ -157477,7 +157460,7 @@ var ts;
|
|
|
157477
157460
|
var related = ts.find(diag.relatedInformation, function (related) { return related.code === ts.Diagnostics.This_type_parameter_might_need_an_extends_0_constraint.code; });
|
|
157478
157461
|
if (related === undefined || related.file === undefined || related.start === undefined || related.length === undefined)
|
|
157479
157462
|
return;
|
|
157480
|
-
var declaration = findAncestorMatchingSpan(related.file, ts.createTextSpan(related.start, related.length));
|
|
157463
|
+
var declaration = codefix.findAncestorMatchingSpan(related.file, ts.createTextSpan(related.start, related.length));
|
|
157481
157464
|
if (declaration === undefined)
|
|
157482
157465
|
return;
|
|
157483
157466
|
if (ts.isIdentifier(declaration) && ts.isTypeParameterDeclaration(declaration.parent)) {
|
|
@@ -157511,14 +157494,6 @@ var ts;
|
|
|
157511
157494
|
}
|
|
157512
157495
|
}
|
|
157513
157496
|
}
|
|
157514
|
-
function findAncestorMatchingSpan(sourceFile, span) {
|
|
157515
|
-
var end = ts.textSpanEnd(span);
|
|
157516
|
-
var token = ts.getTokenAtPosition(sourceFile, span.start);
|
|
157517
|
-
while (token.end < end) {
|
|
157518
|
-
token = token.parent;
|
|
157519
|
-
}
|
|
157520
|
-
return token;
|
|
157521
|
-
}
|
|
157522
157497
|
function tryGetConstraintFromDiagnosticMessage(messageText) {
|
|
157523
157498
|
var _a = ts.flattenDiagnosticMessageText(messageText, "\n", 0).match(/`extends (.*)`/) || [], _ = _a[0], constraint = _a[1];
|
|
157524
157499
|
return constraint;
|
|
@@ -158399,7 +158374,7 @@ var ts;
|
|
|
158399
158374
|
return { kind: InfoKind.TypeLikeDeclaration, token: token, call: call, modifierFlags: modifierFlags, parentDeclaration: declaration, declSourceFile: declSourceFile, isJSFile: isJSFile };
|
|
158400
158375
|
}
|
|
158401
158376
|
var enumDeclaration = ts.find(symbol.declarations, ts.isEnumDeclaration);
|
|
158402
|
-
if (enumDeclaration && !ts.isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
|
|
158377
|
+
if (enumDeclaration && !(leftExpressionType.flags & 1056 /* TypeFlags.EnumLike */) && !ts.isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
|
|
158403
158378
|
return { kind: InfoKind.Enum, token: token, parentDeclaration: enumDeclaration };
|
|
158404
158379
|
}
|
|
158405
158380
|
return undefined;
|
|
@@ -159064,6 +159039,63 @@ var ts;
|
|
|
159064
159039
|
})(ts || (ts = {}));
|
|
159065
159040
|
/* @internal */
|
|
159066
159041
|
var ts;
|
|
159042
|
+
(function (ts) {
|
|
159043
|
+
var codefix;
|
|
159044
|
+
(function (codefix) {
|
|
159045
|
+
var fixId = "fixNaNEquality";
|
|
159046
|
+
var errorCodes = [
|
|
159047
|
+
ts.Diagnostics.This_condition_will_always_return_0.code,
|
|
159048
|
+
];
|
|
159049
|
+
codefix.registerCodeFix({
|
|
159050
|
+
errorCodes: errorCodes,
|
|
159051
|
+
getCodeActions: function (context) {
|
|
159052
|
+
var sourceFile = context.sourceFile, span = context.span, program = context.program;
|
|
159053
|
+
var info = getInfo(program, sourceFile, span);
|
|
159054
|
+
if (info === undefined)
|
|
159055
|
+
return;
|
|
159056
|
+
var suggestion = info.suggestion, expression = info.expression, arg = info.arg;
|
|
159057
|
+
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, arg, expression); });
|
|
159058
|
+
return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Use_0, suggestion], fixId, ts.Diagnostics.Use_Number_isNaN_in_all_conditions)];
|
|
159059
|
+
},
|
|
159060
|
+
fixIds: [fixId],
|
|
159061
|
+
getAllCodeActions: function (context) {
|
|
159062
|
+
return codefix.codeFixAll(context, errorCodes, function (changes, diag) {
|
|
159063
|
+
var info = getInfo(context.program, diag.file, ts.createTextSpan(diag.start, diag.length));
|
|
159064
|
+
if (info) {
|
|
159065
|
+
doChange(changes, diag.file, info.arg, info.expression);
|
|
159066
|
+
}
|
|
159067
|
+
});
|
|
159068
|
+
}
|
|
159069
|
+
});
|
|
159070
|
+
function getInfo(program, sourceFile, span) {
|
|
159071
|
+
var diag = ts.find(program.getSemanticDiagnostics(sourceFile), function (diag) { return diag.start === span.start && diag.length === span.length; });
|
|
159072
|
+
if (diag === undefined || diag.relatedInformation === undefined)
|
|
159073
|
+
return;
|
|
159074
|
+
var related = ts.find(diag.relatedInformation, function (related) { return related.code === ts.Diagnostics.Did_you_mean_0.code; });
|
|
159075
|
+
if (related === undefined || related.file === undefined || related.start === undefined || related.length === undefined)
|
|
159076
|
+
return;
|
|
159077
|
+
var token = codefix.findAncestorMatchingSpan(related.file, ts.createTextSpan(related.start, related.length));
|
|
159078
|
+
if (token === undefined)
|
|
159079
|
+
return;
|
|
159080
|
+
if (ts.isExpression(token) && ts.isBinaryExpression(token.parent)) {
|
|
159081
|
+
return { suggestion: getSuggestion(related.messageText), expression: token.parent, arg: token };
|
|
159082
|
+
}
|
|
159083
|
+
return undefined;
|
|
159084
|
+
}
|
|
159085
|
+
function doChange(changes, sourceFile, arg, expression) {
|
|
159086
|
+
var callExpression = ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier("Number"), ts.factory.createIdentifier("isNaN")), /*typeArguments*/ undefined, [arg]);
|
|
159087
|
+
var operator = expression.operatorToken.kind;
|
|
159088
|
+
changes.replaceNode(sourceFile, expression, operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */ || operator === 35 /* SyntaxKind.ExclamationEqualsToken */
|
|
159089
|
+
? ts.factory.createPrefixUnaryExpression(53 /* SyntaxKind.ExclamationToken */, callExpression) : callExpression);
|
|
159090
|
+
}
|
|
159091
|
+
function getSuggestion(messageText) {
|
|
159092
|
+
var _a = ts.flattenDiagnosticMessageText(messageText, "\n", 0).match(/\'(.*)\'/) || [], _ = _a[0], suggestion = _a[1];
|
|
159093
|
+
return suggestion;
|
|
159094
|
+
}
|
|
159095
|
+
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
159096
|
+
})(ts || (ts = {}));
|
|
159097
|
+
/* @internal */
|
|
159098
|
+
var ts;
|
|
159067
159099
|
(function (ts) {
|
|
159068
159100
|
var codefix;
|
|
159069
159101
|
(function (codefix) {
|
|
@@ -161750,11 +161782,12 @@ var ts;
|
|
|
161750
161782
|
*/
|
|
161751
161783
|
function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget) {
|
|
161752
161784
|
var symbols;
|
|
161753
|
-
var typeNode = ts.visitNode(importTypeNode, visit
|
|
161785
|
+
var typeNode = ts.visitNode(importTypeNode, visit);
|
|
161754
161786
|
if (symbols && typeNode) {
|
|
161755
161787
|
return { typeNode: typeNode, symbols: symbols };
|
|
161756
161788
|
}
|
|
161757
161789
|
function visit(node) {
|
|
161790
|
+
var _a;
|
|
161758
161791
|
if (ts.isLiteralImportTypeNode(node) && node.qualifier) {
|
|
161759
161792
|
// Symbol for the left-most thing after the dot
|
|
161760
161793
|
var firstIdentifier = ts.getFirstIdentifier(node.qualifier);
|
|
@@ -161763,7 +161796,7 @@ var ts;
|
|
|
161763
161796
|
? replaceFirstIdentifierOfEntityName(node.qualifier, ts.factory.createIdentifier(name))
|
|
161764
161797
|
: node.qualifier;
|
|
161765
161798
|
symbols = ts.append(symbols, firstIdentifier.symbol);
|
|
161766
|
-
var typeArguments =
|
|
161799
|
+
var typeArguments = (_a = node.typeArguments) === null || _a === void 0 ? void 0 : _a.map(visit);
|
|
161767
161800
|
return ts.factory.createTypeReferenceNode(qualifier, typeArguments);
|
|
161768
161801
|
}
|
|
161769
161802
|
return ts.visitEachChild(node, visit, ts.nullTransformationContext);
|
|
@@ -161780,6 +161813,15 @@ var ts;
|
|
|
161780
161813
|
symbols.forEach(function (s) { return importAdder.addImportFromExportedSymbol(s, /*isValidTypeOnlyUseSite*/ true); });
|
|
161781
161814
|
}
|
|
161782
161815
|
codefix.importSymbols = importSymbols;
|
|
161816
|
+
function findAncestorMatchingSpan(sourceFile, span) {
|
|
161817
|
+
var end = ts.textSpanEnd(span);
|
|
161818
|
+
var token = ts.getTokenAtPosition(sourceFile, span.start);
|
|
161819
|
+
while (token.end < end) {
|
|
161820
|
+
token = token.parent;
|
|
161821
|
+
}
|
|
161822
|
+
return token;
|
|
161823
|
+
}
|
|
161824
|
+
codefix.findAncestorMatchingSpan = findAncestorMatchingSpan;
|
|
161783
161825
|
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
161784
161826
|
})(ts || (ts = {}));
|
|
161785
161827
|
/* @internal */
|
|
@@ -162838,7 +162880,6 @@ var ts;
|
|
|
162838
162880
|
return { edits: edits, renameFilename: undefined, renameLocation: undefined };
|
|
162839
162881
|
},
|
|
162840
162882
|
});
|
|
162841
|
-
;
|
|
162842
162883
|
function getInfo(context, considerPartialSpans) {
|
|
162843
162884
|
if (considerPartialSpans === void 0) { considerPartialSpans = true; }
|
|
162844
162885
|
var file = context.file, program = context.program;
|
|
@@ -163315,7 +163356,6 @@ var ts;
|
|
|
163315
163356
|
});
|
|
163316
163357
|
return { edits: edits, renameFilename: undefined, renameLocation: undefined };
|
|
163317
163358
|
}
|
|
163318
|
-
;
|
|
163319
163359
|
function isValidExpression(node) {
|
|
163320
163360
|
return ts.isBinaryExpression(node) || ts.isConditionalExpression(node);
|
|
163321
163361
|
}
|
|
@@ -163363,7 +163403,6 @@ var ts;
|
|
|
163363
163403
|
if (expression.operatorToken.kind !== 55 /* SyntaxKind.AmpersandAmpersandToken */) {
|
|
163364
163404
|
return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Can_only_convert_logical_AND_access_chains) };
|
|
163365
163405
|
}
|
|
163366
|
-
;
|
|
163367
163406
|
var finalExpression = getFinalExpressionInChain(expression.right);
|
|
163368
163407
|
if (!finalExpression)
|
|
163369
163408
|
return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_convertible_access_expression) };
|
|
@@ -164880,7 +164919,7 @@ var ts;
|
|
|
164880
164919
|
var statements = ts.factory.createNodeArray(ts.isBlock(body) ? body.statements.slice(0) : [ts.isStatement(body) ? body : ts.factory.createReturnStatement(ts.skipParentheses(body))]);
|
|
164881
164920
|
// rewrite body if either there are writes that should be propagated back via return statements or there are substitutions
|
|
164882
164921
|
if (hasWritesOrVariableDeclarations || substitutions.size) {
|
|
164883
|
-
var rewrittenStatements = ts.visitNodes(statements, visitor
|
|
164922
|
+
var rewrittenStatements = ts.visitNodes(statements, visitor).slice();
|
|
164884
164923
|
if (hasWritesOrVariableDeclarations && !hasReturn && ts.isStatement(body)) {
|
|
164885
164924
|
// add return at the end to propagate writes back in case if control flow falls out of the function body
|
|
164886
164925
|
// it is ok to know that range has at least one return since it we only allow unconditional returns
|
|
@@ -165707,7 +165746,6 @@ var ts;
|
|
|
165707
165746
|
(function (ts) {
|
|
165708
165747
|
var refactor;
|
|
165709
165748
|
(function (refactor) {
|
|
165710
|
-
;
|
|
165711
165749
|
/**
|
|
165712
165750
|
* Checks if some refactor info has refactor error info.
|
|
165713
165751
|
*/
|
|
@@ -165812,7 +165850,6 @@ var ts;
|
|
|
165812
165850
|
// Imports will be copied to the new file anyway, and may still be needed in the old file.
|
|
165813
165851
|
// Prologue directives will be copied to the new file and should be left in the old file.
|
|
165814
165852
|
return !isPureImport(statement) && !ts.isPrologueDirective(statement);
|
|
165815
|
-
;
|
|
165816
165853
|
}
|
|
165817
165854
|
function isPureImport(node) {
|
|
165818
165855
|
switch (node.kind) {
|
|
@@ -175448,7 +175485,7 @@ var ts;
|
|
|
175448
175485
|
// raw is now fixed and ready
|
|
175449
175486
|
this.safelist = raw.typesMap;
|
|
175450
175487
|
for (var key in raw.simpleMap) {
|
|
175451
|
-
if (raw.simpleMap
|
|
175488
|
+
if (ts.hasProperty(raw.simpleMap, key)) {
|
|
175452
175489
|
this.legacySafelist.set(key, raw.simpleMap[key].toLowerCase());
|
|
175453
175490
|
}
|
|
175454
175491
|
}
|
|
@@ -178862,7 +178899,6 @@ var ts;
|
|
|
178862
178899
|
}
|
|
178863
178900
|
return ts.deduplicate(outputs, ts.equateValues);
|
|
178864
178901
|
}
|
|
178865
|
-
;
|
|
178866
178902
|
function createDocumentSpanSet() {
|
|
178867
178903
|
return ts.createSet(function (_a) {
|
|
178868
178904
|
var textSpan = _a.textSpan;
|
|
@@ -183728,7 +183764,7 @@ var ts;
|
|
|
183728
183764
|
(name === undefined || typeof name === "string" || ts.isPropertyName(name)) &&
|
|
183729
183765
|
(questionToken === undefined || typeof questionToken === "object" && ts.isQuestionToken(questionToken)) &&
|
|
183730
183766
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
183731
|
-
(parameters === undefined || ts.
|
|
183767
|
+
(parameters === undefined || !ts.some(parameters, ts.isTypeParameterDeclaration)) &&
|
|
183732
183768
|
(type === undefined || !ts.isArray(type)) &&
|
|
183733
183769
|
(body === undefined || ts.isBlock(body));
|
|
183734
183770
|
},
|
|
@@ -183738,7 +183774,7 @@ var ts;
|
|
|
183738
183774
|
(asteriskToken === undefined || typeof asteriskToken === "object" && ts.isAsteriskToken(asteriskToken)) &&
|
|
183739
183775
|
(name === undefined || typeof name === "string" || ts.isPropertyName(name)) &&
|
|
183740
183776
|
(questionToken === undefined || !ts.isArray(questionToken)) &&
|
|
183741
|
-
(typeParameters === undefined || ts.
|
|
183777
|
+
(typeParameters === undefined || !ts.some(typeParameters, ts.isParameter)) &&
|
|
183742
183778
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
183743
183779
|
(type === undefined || ts.isTypeNode(type)) &&
|
|
183744
183780
|
(body === undefined || ts.isBlock(body));
|
|
@@ -183765,7 +183801,7 @@ var ts;
|
|
|
183765
183801
|
(name === undefined || typeof name === "string" || ts.isPropertyName(name)) &&
|
|
183766
183802
|
(questionToken === undefined || typeof questionToken === "object" && ts.isQuestionToken(questionToken)) &&
|
|
183767
183803
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
183768
|
-
(parameters === undefined || ts.
|
|
183804
|
+
(parameters === undefined || !ts.some(parameters, ts.isTypeParameterDeclaration)) &&
|
|
183769
183805
|
(type === undefined || !ts.isArray(type)) &&
|
|
183770
183806
|
(body === undefined || ts.isBlock(body));
|
|
183771
183807
|
},
|
|
@@ -183775,7 +183811,7 @@ var ts;
|
|
|
183775
183811
|
(asteriskToken === undefined || typeof asteriskToken === "object" && ts.isAsteriskToken(asteriskToken)) &&
|
|
183776
183812
|
(name === undefined || typeof name === "string" || ts.isPropertyName(name)) &&
|
|
183777
183813
|
(questionToken === undefined || !ts.isArray(questionToken)) &&
|
|
183778
|
-
(typeParameters === undefined || ts.
|
|
183814
|
+
(typeParameters === undefined || !ts.some(typeParameters, ts.isParameter)) &&
|
|
183779
183815
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
183780
183816
|
(type === undefined || ts.isTypeNode(type)) &&
|
|
183781
183817
|
(body === undefined || ts.isBlock(body));
|
|
@@ -183798,14 +183834,14 @@ var ts;
|
|
|
183798
183834
|
0: function (_a) {
|
|
183799
183835
|
var modifiers = _a[0], parameters = _a[1], body = _a[2], other = _a[3];
|
|
183800
183836
|
return (other === undefined) &&
|
|
183801
|
-
(modifiers === undefined || ts.
|
|
183802
|
-
(parameters === undefined || ts.
|
|
183837
|
+
(modifiers === undefined || !ts.some(modifiers, ts.isDecorator)) &&
|
|
183838
|
+
(parameters === undefined || !ts.some(parameters, ts.isModifier)) &&
|
|
183803
183839
|
(body === undefined || !ts.isArray(body));
|
|
183804
183840
|
},
|
|
183805
183841
|
1: function (_a) {
|
|
183806
183842
|
var decorators = _a[0], modifiers = _a[1], parameters = _a[2], body = _a[3];
|
|
183807
|
-
return (decorators === undefined || ts.
|
|
183808
|
-
(modifiers === undefined || ts.
|
|
183843
|
+
return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
|
|
183844
|
+
(modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
|
|
183809
183845
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
183810
183846
|
(body === undefined || ts.isBlock(body));
|
|
183811
183847
|
},
|
|
@@ -183827,14 +183863,14 @@ var ts;
|
|
|
183827
183863
|
0: function (_a) {
|
|
183828
183864
|
var modifiers = _a[1], parameters = _a[2], body = _a[3], other = _a[4];
|
|
183829
183865
|
return (other === undefined) &&
|
|
183830
|
-
(modifiers === undefined || ts.
|
|
183831
|
-
(parameters === undefined || ts.
|
|
183866
|
+
(modifiers === undefined || !ts.some(modifiers, ts.isDecorator)) &&
|
|
183867
|
+
(parameters === undefined || !ts.some(parameters, ts.isModifier)) &&
|
|
183832
183868
|
(body === undefined || !ts.isArray(body));
|
|
183833
183869
|
},
|
|
183834
183870
|
1: function (_a) {
|
|
183835
183871
|
var decorators = _a[1], modifiers = _a[2], parameters = _a[3], body = _a[4];
|
|
183836
|
-
return (decorators === undefined || ts.
|
|
183837
|
-
(modifiers === undefined || ts.
|
|
183872
|
+
return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
|
|
183873
|
+
(modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
|
|
183838
183874
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
183839
183875
|
(body === undefined || ts.isBlock(body));
|
|
183840
183876
|
},
|
|
@@ -183976,14 +184012,14 @@ var ts;
|
|
|
183976
184012
|
0: function (_a) {
|
|
183977
184013
|
var modifiers = _a[0], parameters = _a[1], type = _a[2], other = _a[3];
|
|
183978
184014
|
return (other === undefined) &&
|
|
183979
|
-
(modifiers === undefined || ts.
|
|
183980
|
-
(parameters === undefined || ts.
|
|
184015
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184016
|
+
(parameters === undefined || ts.every(parameters, ts.isParameter)) &&
|
|
183981
184017
|
(type === undefined || !ts.isArray(type));
|
|
183982
184018
|
},
|
|
183983
184019
|
1: function (_a) {
|
|
183984
184020
|
var decorators = _a[0], modifiers = _a[1], parameters = _a[2], type = _a[3];
|
|
183985
|
-
return (decorators === undefined || ts.
|
|
183986
|
-
(modifiers === undefined || ts.
|
|
184021
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184022
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
183987
184023
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
183988
184024
|
(type === undefined || ts.isTypeNode(type));
|
|
183989
184025
|
},
|
|
@@ -184005,14 +184041,14 @@ var ts;
|
|
|
184005
184041
|
0: function (_a) {
|
|
184006
184042
|
var modifiers = _a[1], parameters = _a[2], type = _a[3], other = _a[4];
|
|
184007
184043
|
return (other === undefined) &&
|
|
184008
|
-
(modifiers === undefined || ts.
|
|
184009
|
-
(parameters === undefined || ts.
|
|
184044
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184045
|
+
(parameters === undefined || ts.every(parameters, ts.isParameter)) &&
|
|
184010
184046
|
(type === undefined || !ts.isArray(type));
|
|
184011
184047
|
},
|
|
184012
184048
|
1: function (_a) {
|
|
184013
184049
|
var decorators = _a[1], modifiers = _a[2], parameters = _a[3], type = _a[4];
|
|
184014
|
-
return (decorators === undefined || ts.
|
|
184015
|
-
(modifiers === undefined || ts.
|
|
184050
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184051
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184016
184052
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
184017
184053
|
(type === undefined || ts.isTypeNode(type));
|
|
184018
184054
|
},
|
|
@@ -184090,15 +184126,15 @@ var ts;
|
|
|
184090
184126
|
return (other === undefined) &&
|
|
184091
184127
|
(name === undefined || !ts.isArray(name)) &&
|
|
184092
184128
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
184093
|
-
(heritageClauses === undefined || ts.
|
|
184094
|
-
(members === undefined || ts.
|
|
184129
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184130
|
+
(members === undefined || ts.every(members, ts.isClassElement));
|
|
184095
184131
|
},
|
|
184096
184132
|
1: function (_a) {
|
|
184097
184133
|
var modifiers = _a[1], name = _a[2], typeParameters = _a[3], heritageClauses = _a[4], members = _a[5];
|
|
184098
184134
|
return (modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184099
184135
|
(name === undefined || !ts.isArray(name)) &&
|
|
184100
|
-
(typeParameters === undefined || ts.
|
|
184101
|
-
(heritageClauses === undefined || ts.
|
|
184136
|
+
(typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
|
|
184137
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184102
184138
|
(members === undefined || ts.isArray(members));
|
|
184103
184139
|
},
|
|
184104
184140
|
})
|
|
@@ -184121,15 +184157,15 @@ var ts;
|
|
|
184121
184157
|
return (other === undefined) &&
|
|
184122
184158
|
(name === undefined || !ts.isArray(name)) &&
|
|
184123
184159
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
184124
|
-
(heritageClauses === undefined || ts.
|
|
184125
|
-
(members === undefined || ts.
|
|
184160
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184161
|
+
(members === undefined || ts.every(members, ts.isClassElement));
|
|
184126
184162
|
},
|
|
184127
184163
|
1: function (_a) {
|
|
184128
184164
|
var modifiers = _a[2], name = _a[3], typeParameters = _a[4], heritageClauses = _a[5], members = _a[6];
|
|
184129
184165
|
return (modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184130
184166
|
(name === undefined || !ts.isArray(name)) &&
|
|
184131
|
-
(typeParameters === undefined || ts.
|
|
184132
|
-
(heritageClauses === undefined || ts.
|
|
184167
|
+
(typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
|
|
184168
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184133
184169
|
(members === undefined || ts.isArray(members));
|
|
184134
184170
|
},
|
|
184135
184171
|
})
|
|
@@ -184153,7 +184189,7 @@ var ts;
|
|
|
184153
184189
|
(asteriskToken === undefined || !ts.isArray(asteriskToken)) &&
|
|
184154
184190
|
(name === undefined || typeof name === "string" || ts.isIdentifier(name)) &&
|
|
184155
184191
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
184156
|
-
(parameters === undefined || ts.
|
|
184192
|
+
(parameters === undefined || ts.every(parameters, ts.isParameter)) &&
|
|
184157
184193
|
(type === undefined || !ts.isArray(type)) &&
|
|
184158
184194
|
(body === undefined || ts.isBlock(body));
|
|
184159
184195
|
},
|
|
@@ -184162,7 +184198,7 @@ var ts;
|
|
|
184162
184198
|
return (modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184163
184199
|
(asteriskToken === undefined || typeof asteriskToken !== "string" && ts.isAsteriskToken(asteriskToken)) &&
|
|
184164
184200
|
(name === undefined || !ts.isArray(name)) &&
|
|
184165
|
-
(typeParameters === undefined || ts.
|
|
184201
|
+
(typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
|
|
184166
184202
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
184167
184203
|
(type === undefined || ts.isTypeNode(type)) &&
|
|
184168
184204
|
(body === undefined || ts.isBlock(body));
|
|
@@ -184188,7 +184224,7 @@ var ts;
|
|
|
184188
184224
|
(asteriskToken === undefined || !ts.isArray(asteriskToken)) &&
|
|
184189
184225
|
(name === undefined || ts.isIdentifier(name)) &&
|
|
184190
184226
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
184191
|
-
(parameters === undefined || ts.
|
|
184227
|
+
(parameters === undefined || ts.every(parameters, ts.isParameter)) &&
|
|
184192
184228
|
(type === undefined || !ts.isArray(type)) &&
|
|
184193
184229
|
(body === undefined || ts.isBlock(body));
|
|
184194
184230
|
},
|
|
@@ -184197,7 +184233,7 @@ var ts;
|
|
|
184197
184233
|
return (modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184198
184234
|
(asteriskToken === undefined || typeof asteriskToken !== "string" && ts.isAsteriskToken(asteriskToken)) &&
|
|
184199
184235
|
(name === undefined || !ts.isArray(name)) &&
|
|
184200
|
-
(typeParameters === undefined || ts.
|
|
184236
|
+
(typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
|
|
184201
184237
|
(parameters === undefined || ts.isArray(parameters)) &&
|
|
184202
184238
|
(type === undefined || ts.isTypeNode(type)) &&
|
|
184203
184239
|
(body === undefined || ts.isBlock(body));
|
|
@@ -184222,8 +184258,8 @@ var ts;
|
|
|
184222
184258
|
return (other === undefined) &&
|
|
184223
184259
|
(name === undefined || !ts.isArray(name)) &&
|
|
184224
184260
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
184225
|
-
(heritageClauses === undefined || ts.
|
|
184226
|
-
(members === undefined || ts.
|
|
184261
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184262
|
+
(members === undefined || ts.every(members, ts.isClassElement));
|
|
184227
184263
|
},
|
|
184228
184264
|
1: function () { return true; },
|
|
184229
184265
|
})
|
|
@@ -184246,15 +184282,15 @@ var ts;
|
|
|
184246
184282
|
return (other === undefined) &&
|
|
184247
184283
|
(name === undefined || !ts.isArray(name)) &&
|
|
184248
184284
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
184249
|
-
(heritageClauses === undefined || ts.
|
|
184250
|
-
(members === undefined || ts.
|
|
184285
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184286
|
+
(members === undefined || ts.every(members, ts.isClassElement));
|
|
184251
184287
|
},
|
|
184252
184288
|
1: function (_a) {
|
|
184253
184289
|
var modifiers = _a[2], name = _a[3], typeParameters = _a[4], heritageClauses = _a[5], members = _a[6];
|
|
184254
184290
|
return (modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184255
184291
|
(name === undefined || !ts.isArray(name)) &&
|
|
184256
|
-
(typeParameters === undefined || ts.
|
|
184257
|
-
(heritageClauses === undefined || ts.
|
|
184292
|
+
(typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
|
|
184293
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184258
184294
|
(members === undefined || ts.isArray(members));
|
|
184259
184295
|
},
|
|
184260
184296
|
})
|
|
@@ -184275,19 +184311,19 @@ var ts;
|
|
|
184275
184311
|
0: function (_a) {
|
|
184276
184312
|
var modifiers = _a[0], name = _a[1], typeParameters = _a[2], heritageClauses = _a[3], members = _a[4], other = _a[5];
|
|
184277
184313
|
return (other === undefined) &&
|
|
184278
|
-
(modifiers === undefined || ts.
|
|
184314
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184279
184315
|
(name === undefined || !ts.isArray(name)) &&
|
|
184280
184316
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
184281
|
-
(heritageClauses === undefined || ts.
|
|
184282
|
-
(members === undefined || ts.
|
|
184317
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184318
|
+
(members === undefined || ts.every(members, ts.isTypeElement));
|
|
184283
184319
|
},
|
|
184284
184320
|
1: function (_a) {
|
|
184285
184321
|
var decorators = _a[0], modifiers = _a[1], name = _a[2], typeParameters = _a[3], heritageClauses = _a[4], members = _a[5];
|
|
184286
|
-
return (decorators === undefined || ts.
|
|
184322
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184287
184323
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184288
184324
|
(name === undefined || !ts.isArray(name)) &&
|
|
184289
|
-
(typeParameters === undefined || ts.
|
|
184290
|
-
(heritageClauses === undefined || ts.
|
|
184325
|
+
(typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
|
|
184326
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184291
184327
|
(members === undefined || ts.every(members, ts.isTypeElement));
|
|
184292
184328
|
},
|
|
184293
184329
|
})
|
|
@@ -184308,19 +184344,19 @@ var ts;
|
|
|
184308
184344
|
0: function (_a) {
|
|
184309
184345
|
var modifiers = _a[1], name = _a[2], typeParameters = _a[3], heritageClauses = _a[4], members = _a[5], other = _a[6];
|
|
184310
184346
|
return (other === undefined) &&
|
|
184311
|
-
(modifiers === undefined || ts.
|
|
184347
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184312
184348
|
(name === undefined || !ts.isArray(name)) &&
|
|
184313
184349
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
184314
|
-
(heritageClauses === undefined || ts.
|
|
184315
|
-
(members === undefined || ts.
|
|
184350
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184351
|
+
(members === undefined || ts.every(members, ts.isTypeElement));
|
|
184316
184352
|
},
|
|
184317
184353
|
1: function (_a) {
|
|
184318
184354
|
var decorators = _a[1], modifiers = _a[2], name = _a[3], typeParameters = _a[4], heritageClauses = _a[5], members = _a[6];
|
|
184319
|
-
return (decorators === undefined || ts.
|
|
184355
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184320
184356
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184321
184357
|
(name === undefined || !ts.isArray(name)) &&
|
|
184322
|
-
(typeParameters === undefined || ts.
|
|
184323
|
-
(heritageClauses === undefined || ts.
|
|
184358
|
+
(typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
|
|
184359
|
+
(heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
|
|
184324
184360
|
(members === undefined || ts.every(members, ts.isTypeElement));
|
|
184325
184361
|
},
|
|
184326
184362
|
})
|
|
@@ -184341,14 +184377,14 @@ var ts;
|
|
|
184341
184377
|
0: function (_a) {
|
|
184342
184378
|
var modifiers = _a[0], name = _a[1], typeParameters = _a[2], type = _a[3], other = _a[4];
|
|
184343
184379
|
return (other === undefined) &&
|
|
184344
|
-
(modifiers === undefined || ts.
|
|
184380
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184345
184381
|
(name === undefined || !ts.isArray(name)) &&
|
|
184346
184382
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
184347
184383
|
(type === undefined || !ts.isArray(type));
|
|
184348
184384
|
},
|
|
184349
184385
|
1: function (_a) {
|
|
184350
184386
|
var decorators = _a[0], modifiers = _a[1], name = _a[2], typeParameters = _a[3], type = _a[4];
|
|
184351
|
-
return (decorators === undefined || ts.
|
|
184387
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184352
184388
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184353
184389
|
(name === undefined || !ts.isArray(name)) &&
|
|
184354
184390
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
@@ -184372,14 +184408,14 @@ var ts;
|
|
|
184372
184408
|
0: function (_a) {
|
|
184373
184409
|
var modifiers = _a[1], name = _a[2], typeParameters = _a[3], type = _a[4], other = _a[5];
|
|
184374
184410
|
return (other === undefined) &&
|
|
184375
|
-
(modifiers === undefined || ts.
|
|
184411
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184376
184412
|
(name === undefined || !ts.isArray(name)) &&
|
|
184377
184413
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
184378
184414
|
(type === undefined || !ts.isArray(type));
|
|
184379
184415
|
},
|
|
184380
184416
|
1: function (_a) {
|
|
184381
184417
|
var decorators = _a[1], modifiers = _a[2], name = _a[3], typeParameters = _a[4], type = _a[5];
|
|
184382
|
-
return (decorators === undefined || ts.
|
|
184418
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184383
184419
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184384
184420
|
(name === undefined || !ts.isArray(name)) &&
|
|
184385
184421
|
(typeParameters === undefined || ts.isArray(typeParameters)) &&
|
|
@@ -184403,13 +184439,13 @@ var ts;
|
|
|
184403
184439
|
0: function (_a) {
|
|
184404
184440
|
var modifiers = _a[0], name = _a[1], members = _a[2], other = _a[3];
|
|
184405
184441
|
return (other === undefined) &&
|
|
184406
|
-
(modifiers === undefined || ts.
|
|
184442
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184407
184443
|
(name === undefined || !ts.isArray(name)) &&
|
|
184408
184444
|
(members === undefined || ts.isArray(members));
|
|
184409
184445
|
},
|
|
184410
184446
|
1: function (_a) {
|
|
184411
184447
|
var decorators = _a[0], modifiers = _a[1], name = _a[2], members = _a[3];
|
|
184412
|
-
return (decorators === undefined || ts.
|
|
184448
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184413
184449
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184414
184450
|
(name === undefined || !ts.isArray(name)) &&
|
|
184415
184451
|
(members === undefined || ts.isArray(members));
|
|
@@ -184432,13 +184468,13 @@ var ts;
|
|
|
184432
184468
|
0: function (_a) {
|
|
184433
184469
|
var modifiers = _a[1], name = _a[2], members = _a[3], other = _a[4];
|
|
184434
184470
|
return (other === undefined) &&
|
|
184435
|
-
(modifiers === undefined || ts.
|
|
184471
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184436
184472
|
(name === undefined || !ts.isArray(name)) &&
|
|
184437
184473
|
(members === undefined || ts.isArray(members));
|
|
184438
184474
|
},
|
|
184439
184475
|
1: function (_a) {
|
|
184440
184476
|
var decorators = _a[1], modifiers = _a[2], name = _a[3], members = _a[4];
|
|
184441
|
-
return (decorators === undefined || ts.
|
|
184477
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184442
184478
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184443
184479
|
(name === undefined || !ts.isArray(name)) &&
|
|
184444
184480
|
(members === undefined || ts.isArray(members));
|
|
@@ -184461,14 +184497,14 @@ var ts;
|
|
|
184461
184497
|
0: function (_a) {
|
|
184462
184498
|
var modifiers = _a[0], name = _a[1], body = _a[2], flags = _a[3], other = _a[4];
|
|
184463
184499
|
return (other === undefined) &&
|
|
184464
|
-
(modifiers === undefined || ts.
|
|
184500
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184465
184501
|
(name !== undefined && !ts.isArray(name)) &&
|
|
184466
184502
|
(body === undefined || ts.isModuleBody(body)) &&
|
|
184467
184503
|
(flags === undefined || typeof flags === "number");
|
|
184468
184504
|
},
|
|
184469
184505
|
1: function (_a) {
|
|
184470
184506
|
var decorators = _a[0], modifiers = _a[1], name = _a[2], body = _a[3], flags = _a[4];
|
|
184471
|
-
return (decorators === undefined || ts.
|
|
184507
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184472
184508
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184473
184509
|
(name !== undefined && ts.isModuleName(name)) &&
|
|
184474
184510
|
(body === undefined || typeof body === "object") &&
|
|
@@ -184492,13 +184528,13 @@ var ts;
|
|
|
184492
184528
|
0: function (_a) {
|
|
184493
184529
|
var modifiers = _a[1], name = _a[2], body = _a[3], other = _a[4];
|
|
184494
184530
|
return (other === undefined) &&
|
|
184495
|
-
(modifiers === undefined || ts.
|
|
184531
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184496
184532
|
(name === undefined || !ts.isArray(name)) &&
|
|
184497
184533
|
(body === undefined || ts.isModuleBody(body));
|
|
184498
184534
|
},
|
|
184499
184535
|
1: function (_a) {
|
|
184500
184536
|
var decorators = _a[1], modifiers = _a[2], name = _a[3], body = _a[4];
|
|
184501
|
-
return (decorators === undefined || ts.
|
|
184537
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184502
184538
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184503
184539
|
(name !== undefined && ts.isModuleName(name)) &&
|
|
184504
184540
|
(body === undefined || ts.isModuleBody(body));
|
|
@@ -184521,14 +184557,14 @@ var ts;
|
|
|
184521
184557
|
0: function (_a) {
|
|
184522
184558
|
var modifiers = _a[0], isTypeOnly = _a[1], name = _a[2], moduleReference = _a[3], other = _a[4];
|
|
184523
184559
|
return (other === undefined) &&
|
|
184524
|
-
(modifiers === undefined || ts.
|
|
184560
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184525
184561
|
(isTypeOnly === undefined || typeof isTypeOnly === "boolean") &&
|
|
184526
184562
|
(typeof name !== "boolean") &&
|
|
184527
184563
|
(typeof moduleReference !== "string");
|
|
184528
184564
|
},
|
|
184529
184565
|
1: function (_a) {
|
|
184530
184566
|
var decorators = _a[0], modifiers = _a[1], isTypeOnly = _a[2], name = _a[3], moduleReference = _a[4];
|
|
184531
|
-
return (decorators === undefined || ts.
|
|
184567
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184532
184568
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184533
184569
|
(isTypeOnly === undefined || typeof isTypeOnly === "boolean") &&
|
|
184534
184570
|
(typeof name === "string" || ts.isIdentifier(name)) &&
|
|
@@ -184552,14 +184588,14 @@ var ts;
|
|
|
184552
184588
|
0: function (_a) {
|
|
184553
184589
|
var modifiers = _a[1], isTypeOnly = _a[2], name = _a[3], moduleReference = _a[4], other = _a[5];
|
|
184554
184590
|
return (other === undefined) &&
|
|
184555
|
-
(modifiers === undefined || ts.
|
|
184591
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184556
184592
|
(isTypeOnly === undefined || typeof isTypeOnly === "boolean") &&
|
|
184557
184593
|
(typeof name !== "boolean") &&
|
|
184558
184594
|
(typeof moduleReference !== "string");
|
|
184559
184595
|
},
|
|
184560
184596
|
1: function (_a) {
|
|
184561
184597
|
var decorators = _a[1], modifiers = _a[2], isTypeOnly = _a[3], name = _a[4], moduleReference = _a[5];
|
|
184562
|
-
return (decorators === undefined || ts.
|
|
184598
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184563
184599
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184564
184600
|
(isTypeOnly === undefined || typeof isTypeOnly === "boolean") &&
|
|
184565
184601
|
(typeof name === "string" || ts.isIdentifier(name)) &&
|
|
@@ -184583,14 +184619,14 @@ var ts;
|
|
|
184583
184619
|
0: function (_a) {
|
|
184584
184620
|
var modifiers = _a[0], importClause = _a[1], moduleSpecifier = _a[2], assertClause = _a[3], other = _a[4];
|
|
184585
184621
|
return (other === undefined) &&
|
|
184586
|
-
(modifiers === undefined || ts.
|
|
184622
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184587
184623
|
(importClause === undefined || !ts.isArray(importClause)) &&
|
|
184588
184624
|
(moduleSpecifier !== undefined && ts.isExpression(moduleSpecifier)) &&
|
|
184589
184625
|
(assertClause === undefined || ts.isAssertClause(assertClause));
|
|
184590
184626
|
},
|
|
184591
184627
|
1: function (_a) {
|
|
184592
184628
|
var decorators = _a[0], modifiers = _a[1], importClause = _a[2], moduleSpecifier = _a[3], assertClause = _a[4];
|
|
184593
|
-
return (decorators === undefined || ts.
|
|
184629
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184594
184630
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184595
184631
|
(importClause === undefined || ts.isImportClause(importClause)) &&
|
|
184596
184632
|
(moduleSpecifier !== undefined && ts.isExpression(moduleSpecifier)) &&
|
|
@@ -184614,14 +184650,14 @@ var ts;
|
|
|
184614
184650
|
0: function (_a) {
|
|
184615
184651
|
var modifiers = _a[1], importClause = _a[2], moduleSpecifier = _a[3], assertClause = _a[4], other = _a[5];
|
|
184616
184652
|
return (other === undefined) &&
|
|
184617
|
-
(modifiers === undefined || ts.
|
|
184653
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184618
184654
|
(importClause === undefined || !ts.isArray(importClause)) &&
|
|
184619
184655
|
(moduleSpecifier === undefined || ts.isExpression(moduleSpecifier)) &&
|
|
184620
184656
|
(assertClause === undefined || ts.isAssertClause(assertClause));
|
|
184621
184657
|
},
|
|
184622
184658
|
1: function (_a) {
|
|
184623
184659
|
var decorators = _a[1], modifiers = _a[2], importClause = _a[3], moduleSpecifier = _a[4], assertClause = _a[5];
|
|
184624
|
-
return (decorators === undefined || ts.
|
|
184660
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184625
184661
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184626
184662
|
(importClause === undefined || ts.isImportClause(importClause)) &&
|
|
184627
184663
|
(moduleSpecifier !== undefined && ts.isExpression(moduleSpecifier)) &&
|
|
@@ -184645,13 +184681,13 @@ var ts;
|
|
|
184645
184681
|
0: function (_a) {
|
|
184646
184682
|
var modifiers = _a[0], isExportEquals = _a[1], expression = _a[2], other = _a[3];
|
|
184647
184683
|
return (other === undefined) &&
|
|
184648
|
-
(modifiers === undefined || ts.
|
|
184684
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184649
184685
|
(isExportEquals === undefined || typeof isExportEquals === "boolean") &&
|
|
184650
184686
|
(typeof expression === "object");
|
|
184651
184687
|
},
|
|
184652
184688
|
1: function (_a) {
|
|
184653
184689
|
var decorators = _a[0], modifiers = _a[1], isExportEquals = _a[2], expression = _a[3];
|
|
184654
|
-
return (decorators === undefined || ts.
|
|
184690
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184655
184691
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184656
184692
|
(isExportEquals === undefined || typeof isExportEquals === "boolean") &&
|
|
184657
184693
|
(expression !== undefined && ts.isExpression(expression));
|
|
@@ -184674,12 +184710,12 @@ var ts;
|
|
|
184674
184710
|
0: function (_a) {
|
|
184675
184711
|
var modifiers = _a[1], expression = _a[2], other = _a[3];
|
|
184676
184712
|
return (other === undefined) &&
|
|
184677
|
-
(modifiers === undefined || ts.
|
|
184713
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184678
184714
|
(expression !== undefined && !ts.isArray(expression));
|
|
184679
184715
|
},
|
|
184680
184716
|
1: function (_a) {
|
|
184681
184717
|
var decorators = _a[1], modifiers = _a[2], expression = _a[3];
|
|
184682
|
-
return (decorators === undefined || ts.
|
|
184718
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184683
184719
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184684
184720
|
(expression !== undefined && ts.isExpression(expression));
|
|
184685
184721
|
},
|
|
@@ -184701,7 +184737,7 @@ var ts;
|
|
|
184701
184737
|
0: function (_a) {
|
|
184702
184738
|
var modifiers = _a[0], isTypeOnly = _a[1], exportClause = _a[2], moduleSpecifier = _a[3], assertClause = _a[4], other = _a[5];
|
|
184703
184739
|
return (other === undefined) &&
|
|
184704
|
-
(modifiers === undefined || ts.
|
|
184740
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184705
184741
|
(typeof isTypeOnly === "boolean") &&
|
|
184706
184742
|
(typeof exportClause !== "boolean") &&
|
|
184707
184743
|
(moduleSpecifier === undefined || ts.isExpression(moduleSpecifier)) &&
|
|
@@ -184709,7 +184745,7 @@ var ts;
|
|
|
184709
184745
|
},
|
|
184710
184746
|
1: function (_a) {
|
|
184711
184747
|
var decorators = _a[0], modifiers = _a[1], isTypeOnly = _a[2], exportClause = _a[3], moduleSpecifier = _a[4], assertClause = _a[5];
|
|
184712
|
-
return (decorators === undefined || ts.
|
|
184748
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184713
184749
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184714
184750
|
(typeof isTypeOnly === "boolean") &&
|
|
184715
184751
|
(exportClause === undefined || ts.isNamedExportBindings(exportClause)) &&
|
|
@@ -184734,7 +184770,7 @@ var ts;
|
|
|
184734
184770
|
0: function (_a) {
|
|
184735
184771
|
var modifiers = _a[1], isTypeOnly = _a[2], exportClause = _a[3], moduleSpecifier = _a[4], assertClause = _a[5], other = _a[6];
|
|
184736
184772
|
return (other === undefined) &&
|
|
184737
|
-
(modifiers === undefined || ts.
|
|
184773
|
+
(modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
|
|
184738
184774
|
(typeof isTypeOnly === "boolean") &&
|
|
184739
184775
|
(typeof exportClause !== "boolean") &&
|
|
184740
184776
|
(moduleSpecifier === undefined || ts.isExpression(moduleSpecifier)) &&
|
|
@@ -184742,7 +184778,7 @@ var ts;
|
|
|
184742
184778
|
},
|
|
184743
184779
|
1: function (_a) {
|
|
184744
184780
|
var decorators = _a[1], modifiers = _a[2], isTypeOnly = _a[3], exportClause = _a[4], moduleSpecifier = _a[5], assertClause = _a[6];
|
|
184745
|
-
return (decorators === undefined || ts.
|
|
184781
|
+
return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
|
|
184746
184782
|
(modifiers === undefined || ts.isArray(modifiers)) &&
|
|
184747
184783
|
(typeof isTypeOnly === "boolean") &&
|
|
184748
184784
|
(exportClause === undefined || ts.isNamedExportBindings(exportClause)) &&
|