typescript 4.9.0-dev.20220920 → 4.9.0-dev.20220921
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +151 -72
- package/lib/tsserver.js +322 -126
- package/lib/tsserverlibrary.js +322 -126
- package/lib/typescript.js +322 -126
- package/lib/typescriptServices.js +322 -126
- package/lib/typingsInstaller.js +157 -73
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.9";
|
|
72
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
72
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220921");
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -2564,7 +2564,7 @@ var ts;
|
|
|
2564
2564
|
];
|
|
2565
2565
|
for (var _i = 0, nodeConstructors_1 = nodeConstructors; _i < nodeConstructors_1.length; _i++) {
|
|
2566
2566
|
var ctor = nodeConstructors_1[_i];
|
|
2567
|
-
if (!ts.hasProperty(ctor, "__debugKind")) {
|
|
2567
|
+
if (!ts.hasProperty(ctor.prototype, "__debugKind")) {
|
|
2568
2568
|
Object.defineProperties(ctor.prototype, {
|
|
2569
2569
|
__tsDebuggerDisplay: {
|
|
2570
2570
|
value: function () {
|
|
@@ -6282,6 +6282,7 @@ var ts;
|
|
|
6282
6282
|
_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?"),
|
|
6283
6283
|
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."),
|
|
6284
6284
|
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."),
|
|
6285
|
+
This_condition_will_always_return_0: diag(2845, ts.DiagnosticCategory.Error, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."),
|
|
6285
6286
|
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}'."),
|
|
6286
6287
|
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}'."),
|
|
6287
6288
|
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}'."),
|
|
@@ -7224,6 +7225,8 @@ var ts;
|
|
|
7224
7225
|
Delete_unused_param_tag_0: diag(95171, ts.DiagnosticCategory.Message, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"),
|
|
7225
7226
|
Delete_all_unused_param_tags: diag(95172, ts.DiagnosticCategory.Message, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"),
|
|
7226
7227
|
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}'"),
|
|
7228
|
+
Use_0: diag(95174, ts.DiagnosticCategory.Message, "Use_0_95174", "Use `{0}`."),
|
|
7229
|
+
Use_Number_isNaN_in_all_conditions: diag(95175, ts.DiagnosticCategory.Message, "Use_Number_isNaN_in_all_conditions_95175", "Use `Number.isNaN` in all conditions."),
|
|
7227
7230
|
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."),
|
|
7228
7231
|
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'."),
|
|
7229
7232
|
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?"),
|
|
@@ -8855,12 +8858,31 @@ var ts;
|
|
|
8855
8858
|
pos++;
|
|
8856
8859
|
return token = 0;
|
|
8857
8860
|
}
|
|
8858
|
-
|
|
8861
|
+
var charAfterHash = codePointAt(text, pos + 1);
|
|
8862
|
+
if (charAfterHash === 92) {
|
|
8859
8863
|
pos++;
|
|
8860
|
-
|
|
8864
|
+
var extendedCookedChar_1 = peekExtendedUnicodeEscape();
|
|
8865
|
+
if (extendedCookedChar_1 >= 0 && isIdentifierStart(extendedCookedChar_1, languageVersion)) {
|
|
8866
|
+
pos += 3;
|
|
8867
|
+
tokenFlags |= 8;
|
|
8868
|
+
tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
8869
|
+
return token = 80;
|
|
8870
|
+
}
|
|
8871
|
+
var cookedChar_1 = peekUnicodeEscape();
|
|
8872
|
+
if (cookedChar_1 >= 0 && isIdentifierStart(cookedChar_1, languageVersion)) {
|
|
8873
|
+
pos += 6;
|
|
8874
|
+
tokenFlags |= 1024;
|
|
8875
|
+
tokenValue = "#" + String.fromCharCode(cookedChar_1) + scanIdentifierParts();
|
|
8876
|
+
return token = 80;
|
|
8877
|
+
}
|
|
8878
|
+
pos--;
|
|
8879
|
+
}
|
|
8880
|
+
if (isIdentifierStart(charAfterHash, languageVersion)) {
|
|
8881
|
+
pos++;
|
|
8882
|
+
scanIdentifier(charAfterHash, languageVersion);
|
|
8861
8883
|
}
|
|
8862
8884
|
else {
|
|
8863
|
-
tokenValue =
|
|
8885
|
+
tokenValue = "#";
|
|
8864
8886
|
error(ts.Diagnostics.Invalid_character, pos++, charSize(ch));
|
|
8865
8887
|
}
|
|
8866
8888
|
return token = 80;
|
|
@@ -26799,7 +26821,7 @@ var ts;
|
|
|
26799
26821
|
}
|
|
26800
26822
|
function parsePrivateIdentifier() {
|
|
26801
26823
|
var pos = getNodePos();
|
|
26802
|
-
var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.
|
|
26824
|
+
var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenValue()));
|
|
26803
26825
|
nextToken();
|
|
26804
26826
|
return finishNode(node, pos);
|
|
26805
26827
|
}
|
|
@@ -40858,6 +40880,7 @@ var ts;
|
|
|
40858
40880
|
var deferredGlobalOmitSymbol;
|
|
40859
40881
|
var deferredGlobalAwaitedSymbol;
|
|
40860
40882
|
var deferredGlobalBigIntType;
|
|
40883
|
+
var deferredGlobalNaNSymbol;
|
|
40861
40884
|
var deferredGlobalRecordSymbol;
|
|
40862
40885
|
var allPotentiallyUnusedIdentifiers = new ts.Map();
|
|
40863
40886
|
var flowLoopStart = 0;
|
|
@@ -50016,7 +50039,11 @@ var ts;
|
|
|
50016
50039
|
}
|
|
50017
50040
|
}
|
|
50018
50041
|
}
|
|
50019
|
-
if (!singleProp ||
|
|
50042
|
+
if (!singleProp ||
|
|
50043
|
+
isUnion &&
|
|
50044
|
+
(propSet || checkFlags & 48) &&
|
|
50045
|
+
checkFlags & (1024 | 512) &&
|
|
50046
|
+
!(propSet && getCommonDeclarationsOfSymbols(ts.arrayFrom(propSet.values())))) {
|
|
50020
50047
|
return undefined;
|
|
50021
50048
|
}
|
|
50022
50049
|
if (!propSet && !(checkFlags & 16) && !indexTypes) {
|
|
@@ -50106,6 +50133,33 @@ var ts;
|
|
|
50106
50133
|
}
|
|
50107
50134
|
return property;
|
|
50108
50135
|
}
|
|
50136
|
+
function getCommonDeclarationsOfSymbols(symbols) {
|
|
50137
|
+
var commonDeclarations;
|
|
50138
|
+
var _loop_14 = function (symbol) {
|
|
50139
|
+
if (!symbol.declarations) {
|
|
50140
|
+
return { value: undefined };
|
|
50141
|
+
}
|
|
50142
|
+
if (!commonDeclarations) {
|
|
50143
|
+
commonDeclarations = new ts.Set(symbol.declarations);
|
|
50144
|
+
return "continue";
|
|
50145
|
+
}
|
|
50146
|
+
commonDeclarations.forEach(function (declaration) {
|
|
50147
|
+
if (!ts.contains(symbol.declarations, declaration)) {
|
|
50148
|
+
commonDeclarations.delete(declaration);
|
|
50149
|
+
}
|
|
50150
|
+
});
|
|
50151
|
+
if (commonDeclarations.size === 0) {
|
|
50152
|
+
return { value: undefined };
|
|
50153
|
+
}
|
|
50154
|
+
};
|
|
50155
|
+
for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) {
|
|
50156
|
+
var symbol = symbols_3[_i];
|
|
50157
|
+
var state_4 = _loop_14(symbol);
|
|
50158
|
+
if (typeof state_4 === "object")
|
|
50159
|
+
return state_4.value;
|
|
50160
|
+
}
|
|
50161
|
+
return commonDeclarations;
|
|
50162
|
+
}
|
|
50109
50163
|
function getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment) {
|
|
50110
50164
|
var property = getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
50111
50165
|
return property && !(ts.getCheckFlags(property) & 16) ? property : undefined;
|
|
@@ -50736,7 +50790,7 @@ var ts;
|
|
|
50736
50790
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
50737
50791
|
if (indexSymbol.declarations) {
|
|
50738
50792
|
var indexInfos_4 = [];
|
|
50739
|
-
var
|
|
50793
|
+
var _loop_15 = function (declaration) {
|
|
50740
50794
|
if (declaration.parameters.length === 1) {
|
|
50741
50795
|
var parameter = declaration.parameters[0];
|
|
50742
50796
|
if (parameter.type) {
|
|
@@ -50750,7 +50804,7 @@ var ts;
|
|
|
50750
50804
|
};
|
|
50751
50805
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
50752
50806
|
var declaration = _a[_i];
|
|
50753
|
-
|
|
50807
|
+
_loop_15(declaration);
|
|
50754
50808
|
}
|
|
50755
50809
|
return indexInfos_4;
|
|
50756
50810
|
}
|
|
@@ -50767,7 +50821,7 @@ var ts;
|
|
|
50767
50821
|
var _a;
|
|
50768
50822
|
var inferences;
|
|
50769
50823
|
if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
|
|
50770
|
-
var
|
|
50824
|
+
var _loop_16 = function (declaration) {
|
|
50771
50825
|
if (declaration.parent.kind === 192) {
|
|
50772
50826
|
var _c = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _d = _c[0], childTypeParameter = _d === void 0 ? declaration.parent : _d, grandParent = _c[1];
|
|
50773
50827
|
if (grandParent.kind === 180 && !omitTypeReferences) {
|
|
@@ -50812,7 +50866,7 @@ var ts;
|
|
|
50812
50866
|
};
|
|
50813
50867
|
for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
|
|
50814
50868
|
var declaration = _b[_i];
|
|
50815
|
-
|
|
50869
|
+
_loop_16(declaration);
|
|
50816
50870
|
}
|
|
50817
50871
|
}
|
|
50818
50872
|
return inferences && getIntersectionType(inferences);
|
|
@@ -51413,6 +51467,9 @@ var ts;
|
|
|
51413
51467
|
function getGlobalBigIntType() {
|
|
51414
51468
|
return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", 0, false))) || emptyObjectType;
|
|
51415
51469
|
}
|
|
51470
|
+
function getGlobalNaNSymbol() {
|
|
51471
|
+
return (deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol("NaN", false)));
|
|
51472
|
+
}
|
|
51416
51473
|
function getGlobalRecordSymbol() {
|
|
51417
51474
|
deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol("Record", 2, true) || unknownSymbol);
|
|
51418
51475
|
return deferredGlobalRecordSymbol === unknownSymbol ? undefined : deferredGlobalRecordSymbol;
|
|
@@ -51628,7 +51685,7 @@ var ts;
|
|
|
51628
51685
|
var lastRequiredIndex = -1;
|
|
51629
51686
|
var firstRestIndex = -1;
|
|
51630
51687
|
var lastOptionalOrRestIndex = -1;
|
|
51631
|
-
var
|
|
51688
|
+
var _loop_17 = function (i) {
|
|
51632
51689
|
var type = elementTypes[i];
|
|
51633
51690
|
var flags = target.elementFlags[i];
|
|
51634
51691
|
if (flags & 8) {
|
|
@@ -51654,9 +51711,9 @@ var ts;
|
|
|
51654
51711
|
}
|
|
51655
51712
|
};
|
|
51656
51713
|
for (var i = 0; i < elementTypes.length; i++) {
|
|
51657
|
-
var
|
|
51658
|
-
if (typeof
|
|
51659
|
-
return
|
|
51714
|
+
var state_5 = _loop_17(i);
|
|
51715
|
+
if (typeof state_5 === "object")
|
|
51716
|
+
return state_5.value;
|
|
51660
51717
|
}
|
|
51661
51718
|
for (var i = 0; i < lastRequiredIndex; i++) {
|
|
51662
51719
|
if (expandedFlags[i] & 2)
|
|
@@ -51682,7 +51739,7 @@ var ts;
|
|
|
51682
51739
|
if (flags & (2 | 4)) {
|
|
51683
51740
|
lastOptionalOrRestIndex = expandedFlags.length;
|
|
51684
51741
|
}
|
|
51685
|
-
expandedTypes.push(type);
|
|
51742
|
+
expandedTypes.push(flags & 2 ? addOptionality(type, true) : type);
|
|
51686
51743
|
expandedFlags.push(flags);
|
|
51687
51744
|
if (expandedDeclarations && declaration) {
|
|
51688
51745
|
expandedDeclarations.push(declaration);
|
|
@@ -51831,7 +51888,7 @@ var ts;
|
|
|
51831
51888
|
var templates = ts.filter(types, isPatternLiteralType);
|
|
51832
51889
|
if (templates.length) {
|
|
51833
51890
|
var i = types.length;
|
|
51834
|
-
var
|
|
51891
|
+
var _loop_18 = function () {
|
|
51835
51892
|
i--;
|
|
51836
51893
|
var t = types[i];
|
|
51837
51894
|
if (t.flags & 128 && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
@@ -51839,7 +51896,7 @@ var ts;
|
|
|
51839
51896
|
}
|
|
51840
51897
|
};
|
|
51841
51898
|
while (i > 0) {
|
|
51842
|
-
|
|
51899
|
+
_loop_18();
|
|
51843
51900
|
}
|
|
51844
51901
|
}
|
|
51845
51902
|
}
|
|
@@ -51909,14 +51966,14 @@ var ts;
|
|
|
51909
51966
|
var namedUnions = [];
|
|
51910
51967
|
addNamedUnions(namedUnions, types);
|
|
51911
51968
|
var reducedTypes = [];
|
|
51912
|
-
var
|
|
51969
|
+
var _loop_19 = function (t) {
|
|
51913
51970
|
if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
|
|
51914
51971
|
reducedTypes.push(t);
|
|
51915
51972
|
}
|
|
51916
51973
|
};
|
|
51917
51974
|
for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
|
|
51918
51975
|
var t = typeSet_1[_i];
|
|
51919
|
-
|
|
51976
|
+
_loop_19(t);
|
|
51920
51977
|
}
|
|
51921
51978
|
if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
|
|
51922
51979
|
return namedUnions[0];
|
|
@@ -52998,7 +53055,7 @@ var ts;
|
|
|
52998
53055
|
var result;
|
|
52999
53056
|
var extraTypes;
|
|
53000
53057
|
var tailCount = 0;
|
|
53001
|
-
var
|
|
53058
|
+
var _loop_20 = function () {
|
|
53002
53059
|
if (tailCount === 1000) {
|
|
53003
53060
|
error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
53004
53061
|
result = errorType;
|
|
@@ -53072,10 +53129,10 @@ var ts;
|
|
|
53072
53129
|
return "break";
|
|
53073
53130
|
};
|
|
53074
53131
|
while (true) {
|
|
53075
|
-
var
|
|
53076
|
-
if (typeof
|
|
53077
|
-
return
|
|
53078
|
-
if (
|
|
53132
|
+
var state_6 = _loop_20();
|
|
53133
|
+
if (typeof state_6 === "object")
|
|
53134
|
+
return state_6.value;
|
|
53135
|
+
if (state_6 === "break")
|
|
53079
53136
|
break;
|
|
53080
53137
|
}
|
|
53081
53138
|
return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
|
|
@@ -55434,7 +55491,7 @@ var ts;
|
|
|
55434
55491
|
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
|
55435
55492
|
checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
|
|
55436
55493
|
}
|
|
55437
|
-
var
|
|
55494
|
+
var _loop_21 = function (prop) {
|
|
55438
55495
|
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
|
55439
55496
|
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
|
55440
55497
|
if (reportErrors) {
|
|
@@ -55487,9 +55544,9 @@ var ts;
|
|
|
55487
55544
|
};
|
|
55488
55545
|
for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
|
|
55489
55546
|
var prop = _b[_i];
|
|
55490
|
-
var
|
|
55491
|
-
if (typeof
|
|
55492
|
-
return
|
|
55547
|
+
var state_7 = _loop_21(prop);
|
|
55548
|
+
if (typeof state_7 === "object")
|
|
55549
|
+
return state_7.value;
|
|
55493
55550
|
}
|
|
55494
55551
|
return false;
|
|
55495
55552
|
}
|
|
@@ -56266,11 +56323,11 @@ var ts;
|
|
|
56266
56323
|
}
|
|
56267
56324
|
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
|
56268
56325
|
var matchingTypes = [];
|
|
56269
|
-
var
|
|
56326
|
+
var _loop_22 = function (combination) {
|
|
56270
56327
|
var hasMatch = false;
|
|
56271
56328
|
outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
|
|
56272
56329
|
var type = _d[_c];
|
|
56273
|
-
var
|
|
56330
|
+
var _loop_23 = function (i) {
|
|
56274
56331
|
var sourceProperty = sourcePropertiesFiltered[i];
|
|
56275
56332
|
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
|
56276
56333
|
if (!targetProperty)
|
|
@@ -56283,8 +56340,8 @@ var ts;
|
|
|
56283
56340
|
}
|
|
56284
56341
|
};
|
|
56285
56342
|
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
|
56286
|
-
var
|
|
56287
|
-
switch (
|
|
56343
|
+
var state_9 = _loop_23(i);
|
|
56344
|
+
switch (state_9) {
|
|
56288
56345
|
case "continue-outer": continue outer;
|
|
56289
56346
|
}
|
|
56290
56347
|
}
|
|
@@ -56297,9 +56354,9 @@ var ts;
|
|
|
56297
56354
|
};
|
|
56298
56355
|
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
|
56299
56356
|
var combination = discriminantCombinations_1[_a];
|
|
56300
|
-
var
|
|
56301
|
-
if (typeof
|
|
56302
|
-
return
|
|
56357
|
+
var state_8 = _loop_22(combination);
|
|
56358
|
+
if (typeof state_8 === "object")
|
|
56359
|
+
return state_8.value;
|
|
56303
56360
|
}
|
|
56304
56361
|
var result = -1;
|
|
56305
56362
|
for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) {
|
|
@@ -56941,7 +56998,7 @@ var ts;
|
|
|
56941
56998
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
|
|
56942
56999
|
links.variances = ts.emptyArray;
|
|
56943
57000
|
var variances = [];
|
|
56944
|
-
var
|
|
57001
|
+
var _loop_24 = function (tp) {
|
|
56945
57002
|
var modifiers = getVarianceModifiers(tp);
|
|
56946
57003
|
var variance = modifiers & 65536 ?
|
|
56947
57004
|
modifiers & 32768 ? 0 : 1 :
|
|
@@ -56972,7 +57029,7 @@ var ts;
|
|
|
56972
57029
|
};
|
|
56973
57030
|
for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
|
|
56974
57031
|
var tp = typeParameters_2[_i];
|
|
56975
|
-
|
|
57032
|
+
_loop_24(tp);
|
|
56976
57033
|
}
|
|
56977
57034
|
links.variances = variances;
|
|
56978
57035
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
|
|
@@ -57483,7 +57540,8 @@ var ts;
|
|
|
57483
57540
|
function getOptionalType(type, isProperty) {
|
|
57484
57541
|
if (isProperty === void 0) { isProperty = false; }
|
|
57485
57542
|
ts.Debug.assert(strictNullChecks);
|
|
57486
|
-
|
|
57543
|
+
var missingOrUndefined = isProperty ? missingType : undefinedType;
|
|
57544
|
+
return type.flags & 32768 || type.flags & 1048576 && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
|
|
57487
57545
|
}
|
|
57488
57546
|
function getGlobalNonNullableTypeInstantiation(type) {
|
|
57489
57547
|
if (!deferredGlobalNonNullableTypeAlias) {
|
|
@@ -58616,7 +58674,7 @@ var ts;
|
|
|
58616
58674
|
var matches = inferTypesFromTemplateLiteralType(source, target);
|
|
58617
58675
|
var types = target.types;
|
|
58618
58676
|
if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
|
|
58619
|
-
var
|
|
58677
|
+
var _loop_25 = function (i) {
|
|
58620
58678
|
var source_1 = matches ? matches[i] : neverType;
|
|
58621
58679
|
var target_3 = types[i];
|
|
58622
58680
|
if (source_1.flags & 128 && target_3.flags & 8650752) {
|
|
@@ -58660,7 +58718,7 @@ var ts;
|
|
|
58660
58718
|
inferFromTypes(source_1, target_3);
|
|
58661
58719
|
};
|
|
58662
58720
|
for (var i = 0; i < types.length; i++) {
|
|
58663
|
-
|
|
58721
|
+
_loop_25(i);
|
|
58664
58722
|
}
|
|
58665
58723
|
}
|
|
58666
58724
|
}
|
|
@@ -59079,7 +59137,7 @@ var ts;
|
|
|
59079
59137
|
return name;
|
|
59080
59138
|
}
|
|
59081
59139
|
}
|
|
59082
|
-
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
59140
|
+
if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
|
|
59083
59141
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
59084
59142
|
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
59085
59143
|
}
|
|
@@ -59135,7 +59193,7 @@ var ts;
|
|
|
59135
59193
|
function mapTypesByKeyProperty(types, name) {
|
|
59136
59194
|
var map = new ts.Map();
|
|
59137
59195
|
var count = 0;
|
|
59138
|
-
var
|
|
59196
|
+
var _loop_26 = function (type) {
|
|
59139
59197
|
if (type.flags & (524288 | 2097152 | 58982400)) {
|
|
59140
59198
|
var discriminant = getTypeOfPropertyOfType(type, name);
|
|
59141
59199
|
if (discriminant) {
|
|
@@ -59161,9 +59219,9 @@ var ts;
|
|
|
59161
59219
|
};
|
|
59162
59220
|
for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
|
|
59163
59221
|
var type = types_15[_i];
|
|
59164
|
-
var
|
|
59165
|
-
if (typeof
|
|
59166
|
-
return
|
|
59222
|
+
var state_10 = _loop_26(type);
|
|
59223
|
+
if (typeof state_10 === "object")
|
|
59224
|
+
return state_10.value;
|
|
59167
59225
|
}
|
|
59168
59226
|
return count >= 10 && count * 2 >= types.length ? map : undefined;
|
|
59169
59227
|
}
|
|
@@ -64665,7 +64723,7 @@ var ts;
|
|
|
64665
64723
|
var spreadIndex = getSpreadArgumentIndex(args);
|
|
64666
64724
|
if (spreadIndex >= 0) {
|
|
64667
64725
|
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
|
64668
|
-
var
|
|
64726
|
+
var _loop_27 = function (i) {
|
|
64669
64727
|
var arg = args[i];
|
|
64670
64728
|
var spreadType = arg.kind === 227 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
64671
64729
|
if (spreadType && isTupleType(spreadType)) {
|
|
@@ -64681,7 +64739,7 @@ var ts;
|
|
|
64681
64739
|
}
|
|
64682
64740
|
};
|
|
64683
64741
|
for (var i = spreadIndex; i < args.length; i++) {
|
|
64684
|
-
|
|
64742
|
+
_loop_27(i);
|
|
64685
64743
|
}
|
|
64686
64744
|
return effectiveArgs_1;
|
|
64687
64745
|
}
|
|
@@ -64931,7 +64989,7 @@ var ts;
|
|
|
64931
64989
|
var min_3 = Number.MAX_VALUE;
|
|
64932
64990
|
var minIndex = 0;
|
|
64933
64991
|
var i_1 = 0;
|
|
64934
|
-
var
|
|
64992
|
+
var _loop_28 = function (c) {
|
|
64935
64993
|
var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
|
|
64936
64994
|
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
|
|
64937
64995
|
if (diags_2) {
|
|
@@ -64949,7 +65007,7 @@ var ts;
|
|
|
64949
65007
|
};
|
|
64950
65008
|
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
|
64951
65009
|
var c = candidatesForArgumentError_1[_a];
|
|
64952
|
-
|
|
65010
|
+
_loop_28(c);
|
|
64953
65011
|
}
|
|
64954
65012
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
64955
65013
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
@@ -65092,7 +65150,7 @@ var ts;
|
|
|
65092
65150
|
}
|
|
65093
65151
|
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
|
65094
65152
|
var parameters = [];
|
|
65095
|
-
var
|
|
65153
|
+
var _loop_29 = function (i) {
|
|
65096
65154
|
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
|
65097
65155
|
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
|
65098
65156
|
i < s.parameters.length ? s.parameters[i] : undefined; });
|
|
@@ -65100,7 +65158,7 @@ var ts;
|
|
|
65100
65158
|
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
|
65101
65159
|
};
|
|
65102
65160
|
for (var i = 0; i < maxNonRestParam; i++) {
|
|
65103
|
-
|
|
65161
|
+
_loop_29(i);
|
|
65104
65162
|
}
|
|
65105
65163
|
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
|
65106
65164
|
var flags = 0;
|
|
@@ -67582,6 +67640,7 @@ var ts;
|
|
|
67582
67640
|
var eqType = operator === 34 || operator === 36;
|
|
67583
67641
|
error(errorNode, ts.Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
|
|
67584
67642
|
}
|
|
67643
|
+
checkNaNEquality(errorNode, operator, left, right);
|
|
67585
67644
|
reportOperatorErrorUnless(function (left, right) { return isTypeEqualityComparableTo(left, right) || isTypeEqualityComparableTo(right, left); });
|
|
67586
67645
|
return booleanType;
|
|
67587
67646
|
case 102:
|
|
@@ -67775,6 +67834,26 @@ var ts;
|
|
|
67775
67834
|
return undefined;
|
|
67776
67835
|
}
|
|
67777
67836
|
}
|
|
67837
|
+
function checkNaNEquality(errorNode, operator, left, right) {
|
|
67838
|
+
var isLeftNaN = isGlobalNaN(ts.skipParentheses(left));
|
|
67839
|
+
var isRightNaN = isGlobalNaN(ts.skipParentheses(right));
|
|
67840
|
+
if (isLeftNaN || isRightNaN) {
|
|
67841
|
+
var err = error(errorNode, ts.Diagnostics.This_condition_will_always_return_0, ts.tokenToString(operator === 36 || operator === 34 ? 95 : 110));
|
|
67842
|
+
if (isLeftNaN && isRightNaN)
|
|
67843
|
+
return;
|
|
67844
|
+
var operatorString = operator === 37 || operator === 35 ? ts.tokenToString(53) : "";
|
|
67845
|
+
var location = isLeftNaN ? right : left;
|
|
67846
|
+
var expression = ts.skipParentheses(location);
|
|
67847
|
+
ts.addRelatedInfo(err, ts.createDiagnosticForNode(location, ts.Diagnostics.Did_you_mean_0, "".concat(operatorString, "Number.isNaN(").concat(ts.isEntityNameExpression(expression) ? ts.entityNameToString(expression) : "...", ")")));
|
|
67848
|
+
}
|
|
67849
|
+
}
|
|
67850
|
+
function isGlobalNaN(expr) {
|
|
67851
|
+
if (ts.isIdentifier(expr) && expr.escapedText === "NaN") {
|
|
67852
|
+
var globalNaNSymbol = getGlobalNaNSymbol();
|
|
67853
|
+
return !!globalNaNSymbol && globalNaNSymbol === getResolvedSymbol(expr);
|
|
67854
|
+
}
|
|
67855
|
+
return false;
|
|
67856
|
+
}
|
|
67778
67857
|
}
|
|
67779
67858
|
function getBaseTypesIfUnrelated(leftType, rightType, isRelated) {
|
|
67780
67859
|
var effectiveLeft = leftType;
|
|
@@ -68696,7 +68775,7 @@ var ts;
|
|
|
68696
68775
|
var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
|
|
68697
68776
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
68698
68777
|
var indexSignatureMap_1 = new ts.Map();
|
|
68699
|
-
var
|
|
68778
|
+
var _loop_30 = function (declaration) {
|
|
68700
68779
|
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
|
68701
68780
|
forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
|
|
68702
68781
|
var entry = indexSignatureMap_1.get(getTypeId(type));
|
|
@@ -68711,7 +68790,7 @@ var ts;
|
|
|
68711
68790
|
};
|
|
68712
68791
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
68713
68792
|
var declaration = _a[_i];
|
|
68714
|
-
|
|
68793
|
+
_loop_30(declaration);
|
|
68715
68794
|
}
|
|
68716
68795
|
indexSignatureMap_1.forEach(function (entry) {
|
|
68717
68796
|
if (entry.declarations.length > 1) {
|
|
@@ -71651,7 +71730,7 @@ var ts;
|
|
|
71651
71730
|
var propDeclaration = declaration && declaration.kind === 223 ||
|
|
71652
71731
|
name && name.kind === 164 ? declaration : undefined;
|
|
71653
71732
|
var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
|
|
71654
|
-
var
|
|
71733
|
+
var _loop_31 = function (info) {
|
|
71655
71734
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
71656
71735
|
var errorNode = localPropDeclaration || localIndexDeclaration ||
|
|
71657
71736
|
(interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
|
|
@@ -71665,7 +71744,7 @@ var ts;
|
|
|
71665
71744
|
};
|
|
71666
71745
|
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
71667
71746
|
var info = indexInfos_9[_i];
|
|
71668
|
-
|
|
71747
|
+
_loop_31(info);
|
|
71669
71748
|
}
|
|
71670
71749
|
}
|
|
71671
71750
|
function checkIndexConstraintForIndexSignature(type, checkInfo) {
|
|
@@ -71673,7 +71752,7 @@ var ts;
|
|
|
71673
71752
|
var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
|
|
71674
71753
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 261) : undefined;
|
|
71675
71754
|
var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
|
|
71676
|
-
var
|
|
71755
|
+
var _loop_32 = function (info) {
|
|
71677
71756
|
if (info === checkInfo)
|
|
71678
71757
|
return "continue";
|
|
71679
71758
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
@@ -71685,7 +71764,7 @@ var ts;
|
|
|
71685
71764
|
};
|
|
71686
71765
|
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
71687
71766
|
var info = indexInfos_10[_i];
|
|
71688
|
-
|
|
71767
|
+
_loop_32(info);
|
|
71689
71768
|
}
|
|
71690
71769
|
}
|
|
71691
71770
|
function checkTypeNameIsReserved(name, message) {
|
|
@@ -71980,7 +72059,7 @@ var ts;
|
|
|
71980
72059
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
71981
72060
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
71982
72061
|
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
71983
|
-
var
|
|
72062
|
+
var _loop_33 = function (member) {
|
|
71984
72063
|
if (ts.hasAmbientModifier(member)) {
|
|
71985
72064
|
return "continue";
|
|
71986
72065
|
}
|
|
@@ -71995,7 +72074,7 @@ var ts;
|
|
|
71995
72074
|
};
|
|
71996
72075
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
71997
72076
|
var member = _a[_i];
|
|
71998
|
-
|
|
72077
|
+
_loop_33(member);
|
|
71999
72078
|
}
|
|
72000
72079
|
}
|
|
72001
72080
|
function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
|
|
@@ -72070,7 +72149,7 @@ var ts;
|
|
|
72070
72149
|
}
|
|
72071
72150
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
72072
72151
|
var issuedMemberError = false;
|
|
72073
|
-
var
|
|
72152
|
+
var _loop_34 = function (member) {
|
|
72074
72153
|
if (ts.isStatic(member)) {
|
|
72075
72154
|
return "continue";
|
|
72076
72155
|
}
|
|
@@ -72088,7 +72167,7 @@ var ts;
|
|
|
72088
72167
|
};
|
|
72089
72168
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
72090
72169
|
var member = _a[_i];
|
|
72091
|
-
|
|
72170
|
+
_loop_34(member);
|
|
72092
72171
|
}
|
|
72093
72172
|
if (!issuedMemberError) {
|
|
72094
72173
|
checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
|
|
@@ -72135,7 +72214,7 @@ var ts;
|
|
|
72135
72214
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
72136
72215
|
var _a, _b, _c, _d;
|
|
72137
72216
|
var baseProperties = getPropertiesOfType(baseType);
|
|
72138
|
-
var
|
|
72217
|
+
var _loop_35 = function (baseProperty) {
|
|
72139
72218
|
var base = getTargetSymbol(baseProperty);
|
|
72140
72219
|
if (base.flags & 4194304) {
|
|
72141
72220
|
return "continue";
|
|
@@ -72233,8 +72312,8 @@ var ts;
|
|
|
72233
72312
|
};
|
|
72234
72313
|
basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
|
|
72235
72314
|
var baseProperty = baseProperties_1[_i];
|
|
72236
|
-
var
|
|
72237
|
-
switch (
|
|
72315
|
+
var state_11 = _loop_35(baseProperty);
|
|
72316
|
+
switch (state_11) {
|
|
72238
72317
|
case "continue-basePropertyCheck": continue basePropertyCheck;
|
|
72239
72318
|
}
|
|
72240
72319
|
}
|
|
@@ -103600,7 +103679,7 @@ var ts;
|
|
|
103600
103679
|
importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
|
|
103601
103680
|
});
|
|
103602
103681
|
var sortedPaths = [];
|
|
103603
|
-
var
|
|
103682
|
+
var _loop_36 = function (directory) {
|
|
103604
103683
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
103605
103684
|
var pathsInDirectory;
|
|
103606
103685
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -103624,9 +103703,9 @@ var ts;
|
|
|
103624
103703
|
};
|
|
103625
103704
|
var out_directory_1;
|
|
103626
103705
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
103627
|
-
var
|
|
103706
|
+
var state_12 = _loop_36(directory);
|
|
103628
103707
|
directory = out_directory_1;
|
|
103629
|
-
if (
|
|
103708
|
+
if (state_12 === "break")
|
|
103630
103709
|
break;
|
|
103631
103710
|
}
|
|
103632
103711
|
if (allFileNames.size) {
|
|
@@ -103685,7 +103764,7 @@ var ts;
|
|
|
103685
103764
|
}
|
|
103686
103765
|
function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
|
|
103687
103766
|
for (var key in paths) {
|
|
103688
|
-
var
|
|
103767
|
+
var _loop_37 = function (patternText_1) {
|
|
103689
103768
|
var pattern = ts.normalizePath(patternText_1);
|
|
103690
103769
|
var indexOfStar = pattern.indexOf("*");
|
|
103691
103770
|
var candidates = allowedEndings.map(function (ending) { return ({
|
|
@@ -103716,9 +103795,9 @@ var ts;
|
|
|
103716
103795
|
};
|
|
103717
103796
|
for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
|
|
103718
103797
|
var patternText_1 = _a[_i];
|
|
103719
|
-
var
|
|
103720
|
-
if (typeof
|
|
103721
|
-
return
|
|
103798
|
+
var state_13 = _loop_37(patternText_1);
|
|
103799
|
+
if (typeof state_13 === "object")
|
|
103800
|
+
return state_13.value;
|
|
103722
103801
|
}
|
|
103723
103802
|
}
|
|
103724
103803
|
function validateEnding(_a) {
|