typescript 4.9.0-dev.20220918 → 4.9.0-dev.20220920
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/cs/diagnosticMessages.generated.json +5 -0
- package/lib/de/diagnosticMessages.generated.json +5 -0
- package/lib/es/diagnosticMessages.generated.json +5 -0
- package/lib/fr/diagnosticMessages.generated.json +5 -0
- package/lib/it/diagnosticMessages.generated.json +5 -0
- package/lib/ja/diagnosticMessages.generated.json +5 -0
- package/lib/ko/diagnosticMessages.generated.json +5 -0
- package/lib/pl/diagnosticMessages.generated.json +5 -0
- package/lib/pt-br/diagnosticMessages.generated.json +5 -0
- package/lib/ru/diagnosticMessages.generated.json +5 -0
- package/lib/tr/diagnosticMessages.generated.json +5 -0
- package/lib/tsc.js +84 -55
- package/lib/tsserver.js +120 -91
- package/lib/tsserverlibrary.js +120 -91
- package/lib/typescript.js +119 -89
- package/lib/typescriptServices.js +119 -89
- package/lib/typingsInstaller.js +113 -76
- package/lib/zh-cn/diagnosticMessages.generated.json +5 -0
- package/lib/zh-tw/diagnosticMessages.generated.json +5 -0
- 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.20220920");
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -2266,7 +2266,7 @@ var ts;
|
|
|
2266
2266
|
if (typeof func !== "function") {
|
|
2267
2267
|
return "";
|
|
2268
2268
|
}
|
|
2269
|
-
else if (
|
|
2269
|
+
else if (ts.hasProperty(func, "name")) {
|
|
2270
2270
|
return func.name;
|
|
2271
2271
|
}
|
|
2272
2272
|
else {
|
|
@@ -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 (!
|
|
2567
|
+
if (!ts.hasProperty(ctor, "__debugKind")) {
|
|
2568
2568
|
Object.defineProperties(ctor.prototype, {
|
|
2569
2569
|
__tsDebuggerDisplay: {
|
|
2570
2570
|
value: function () {
|
|
@@ -3268,7 +3268,6 @@ var ts;
|
|
|
3268
3268
|
var typeCatalog = [];
|
|
3269
3269
|
var legendPath;
|
|
3270
3270
|
var legend = [];
|
|
3271
|
-
;
|
|
3272
3271
|
function startTracing(tracingMode, traceDir, configFilePath) {
|
|
3273
3272
|
ts.Debug.assert(!ts.tracing, "Tracing already started");
|
|
3274
3273
|
if (fs === undefined) {
|
|
@@ -5854,8 +5853,6 @@ var ts;
|
|
|
5854
5853
|
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."),
|
|
5855
5854
|
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."),
|
|
5856
5855
|
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."),
|
|
5857
|
-
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'."),
|
|
5858
|
-
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."),
|
|
5859
5856
|
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."),
|
|
5860
5857
|
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."),
|
|
5861
5858
|
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."),
|
|
@@ -6104,6 +6101,7 @@ var ts;
|
|
|
6104
6101
|
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."),
|
|
6105
6102
|
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."),
|
|
6106
6103
|
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."),
|
|
6104
|
+
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."),
|
|
6107
6105
|
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."),
|
|
6108
6106
|
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."),
|
|
6109
6107
|
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."),
|
|
@@ -7425,7 +7423,7 @@ var ts;
|
|
|
7425
7423
|
}
|
|
7426
7424
|
ts.stringToToken = stringToToken;
|
|
7427
7425
|
function computeLineStarts(text) {
|
|
7428
|
-
var result =
|
|
7426
|
+
var result = [];
|
|
7429
7427
|
var pos = 0;
|
|
7430
7428
|
var lineStart = 0;
|
|
7431
7429
|
while (pos < text.length) {
|
|
@@ -10131,7 +10129,7 @@ var ts;
|
|
|
10131
10129
|
}
|
|
10132
10130
|
ts.isToken = isToken;
|
|
10133
10131
|
function isNodeArray(array) {
|
|
10134
|
-
return
|
|
10132
|
+
return ts.hasProperty(array, "pos") && ts.hasProperty(array, "end");
|
|
10135
10133
|
}
|
|
10136
10134
|
ts.isNodeArray = isNodeArray;
|
|
10137
10135
|
function isLiteralKind(kind) {
|
|
@@ -11415,7 +11413,6 @@ var ts;
|
|
|
11415
11413
|
return emitNode && emitNode.flags || 0;
|
|
11416
11414
|
}
|
|
11417
11415
|
ts.getEmitFlags = getEmitFlags;
|
|
11418
|
-
;
|
|
11419
11416
|
function getScriptTargetFeatures() {
|
|
11420
11417
|
return {
|
|
11421
11418
|
es2015: {
|
|
@@ -15506,7 +15503,7 @@ var ts;
|
|
|
15506
15503
|
return node.initializer !== undefined;
|
|
15507
15504
|
}
|
|
15508
15505
|
function isWatchSet(options) {
|
|
15509
|
-
return options.watch &&
|
|
15506
|
+
return options.watch && ts.hasProperty(options, "watch");
|
|
15510
15507
|
}
|
|
15511
15508
|
ts.isWatchSet = isWatchSet;
|
|
15512
15509
|
function closeFileWatcher(watcher) {
|
|
@@ -21716,7 +21713,7 @@ var ts;
|
|
|
21716
21713
|
clone.transformFlags = node.transformFlags;
|
|
21717
21714
|
setOriginalNode(clone, node);
|
|
21718
21715
|
for (var key in node) {
|
|
21719
|
-
if (
|
|
21716
|
+
if (ts.hasProperty(clone, key) || !ts.hasProperty(node, key)) {
|
|
21720
21717
|
continue;
|
|
21721
21718
|
}
|
|
21722
21719
|
clone[key] = node[key];
|
|
@@ -25760,7 +25757,6 @@ var ts;
|
|
|
25760
25757
|
visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
25761
25758
|
visitNode(cbNode, node.type);
|
|
25762
25759
|
}
|
|
25763
|
-
;
|
|
25764
25760
|
function forEachChildInUnionOrIntersectionType(node, cbNode, cbNodes) {
|
|
25765
25761
|
return visitNodes(cbNode, cbNodes, node.types);
|
|
25766
25762
|
}
|
|
@@ -35256,7 +35252,7 @@ var ts;
|
|
|
35256
35252
|
function convertCompilerOptionsForTelemetry(opts) {
|
|
35257
35253
|
var out = {};
|
|
35258
35254
|
for (var key in opts) {
|
|
35259
|
-
if (
|
|
35255
|
+
if (ts.hasProperty(opts, key)) {
|
|
35260
35256
|
var type = getOptionFromName(key);
|
|
35261
35257
|
if (type !== undefined) {
|
|
35262
35258
|
out[key] = getOptionValueWithEmptyStrings(opts[key], type);
|
|
@@ -40638,6 +40634,7 @@ var ts;
|
|
|
40638
40634
|
isPropertyAccessible: isPropertyAccessible,
|
|
40639
40635
|
getTypeOnlyAliasDeclaration: getTypeOnlyAliasDeclaration,
|
|
40640
40636
|
getMemberOverrideModifierStatus: getMemberOverrideModifierStatus,
|
|
40637
|
+
isTypeParameterPossiblyReferenced: isTypeParameterPossiblyReferenced,
|
|
40641
40638
|
};
|
|
40642
40639
|
function runWithInferenceBlockedFromSourceNode(node, fn) {
|
|
40643
40640
|
var containingCall = ts.findAncestor(node, ts.isCallLikeExpression);
|
|
@@ -40757,7 +40754,8 @@ var ts;
|
|
|
40757
40754
|
var emptyTypeLiteralSymbol = createSymbol(2048, "__type");
|
|
40758
40755
|
emptyTypeLiteralSymbol.members = ts.createSymbolTable();
|
|
40759
40756
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
40760
|
-
var
|
|
40757
|
+
var unknownEmptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
40758
|
+
var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType;
|
|
40761
40759
|
var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
40762
40760
|
emptyGenericType.instantiations = new ts.Map();
|
|
40763
40761
|
var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
@@ -40860,6 +40858,7 @@ var ts;
|
|
|
40860
40858
|
var deferredGlobalOmitSymbol;
|
|
40861
40859
|
var deferredGlobalAwaitedSymbol;
|
|
40862
40860
|
var deferredGlobalBigIntType;
|
|
40861
|
+
var deferredGlobalRecordSymbol;
|
|
40863
40862
|
var allPotentiallyUnusedIdentifiers = new ts.Map();
|
|
40864
40863
|
var flowLoopStart = 0;
|
|
40865
40864
|
var flowLoopCount = 0;
|
|
@@ -41568,10 +41567,10 @@ var ts;
|
|
|
41568
41567
|
return (ts.isAssertionExpression(location) && ts.isConstTypeReference(location.type))
|
|
41569
41568
|
|| (ts.isJSDocTypeTag(location) && ts.isConstTypeReference(location.typeExpression));
|
|
41570
41569
|
}
|
|
41571
|
-
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals,
|
|
41570
|
+
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions) {
|
|
41572
41571
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
41573
|
-
if (
|
|
41574
|
-
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals,
|
|
41572
|
+
if (getSpellingSuggestions === void 0) { getSpellingSuggestions = true; }
|
|
41573
|
+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, getSymbol);
|
|
41575
41574
|
}
|
|
41576
41575
|
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) {
|
|
41577
41576
|
var _a, _b, _c;
|
|
@@ -41682,7 +41681,9 @@ var ts;
|
|
|
41682
41681
|
break;
|
|
41683
41682
|
}
|
|
41684
41683
|
if (lastLocation && ts.isStatic(lastLocation)) {
|
|
41685
|
-
|
|
41684
|
+
if (nameNotFoundMessage) {
|
|
41685
|
+
error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters);
|
|
41686
|
+
}
|
|
41686
41687
|
return undefined;
|
|
41687
41688
|
}
|
|
41688
41689
|
break loop;
|
|
@@ -41710,7 +41711,9 @@ var ts;
|
|
|
41710
41711
|
grandparent = location.parent.parent;
|
|
41711
41712
|
if (ts.isClassLike(grandparent) || grandparent.kind === 261) {
|
|
41712
41713
|
if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968)) {
|
|
41713
|
-
|
|
41714
|
+
if (nameNotFoundMessage) {
|
|
41715
|
+
error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
|
|
41716
|
+
}
|
|
41714
41717
|
return undefined;
|
|
41715
41718
|
}
|
|
41716
41719
|
}
|
|
@@ -41870,7 +41873,7 @@ var ts;
|
|
|
41870
41873
|
}
|
|
41871
41874
|
return undefined;
|
|
41872
41875
|
}
|
|
41873
|
-
else if (checkAndReportErrorForInvalidInitializer()) {
|
|
41876
|
+
else if (nameNotFoundMessage && checkAndReportErrorForInvalidInitializer()) {
|
|
41874
41877
|
return undefined;
|
|
41875
41878
|
}
|
|
41876
41879
|
if (nameNotFoundMessage) {
|
|
@@ -47240,7 +47243,6 @@ var ts;
|
|
|
47240
47243
|
return container;
|
|
47241
47244
|
}
|
|
47242
47245
|
}
|
|
47243
|
-
;
|
|
47244
47246
|
}
|
|
47245
47247
|
function getFlowTypeFromCommonJSExport(symbol) {
|
|
47246
47248
|
var file = ts.getSourceFileOfNode(symbol.declarations[0]);
|
|
@@ -51411,6 +51413,10 @@ var ts;
|
|
|
51411
51413
|
function getGlobalBigIntType() {
|
|
51412
51414
|
return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", 0, false))) || emptyObjectType;
|
|
51413
51415
|
}
|
|
51416
|
+
function getGlobalRecordSymbol() {
|
|
51417
|
+
deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol("Record", 2, true) || unknownSymbol);
|
|
51418
|
+
return deferredGlobalRecordSymbol === unknownSymbol ? undefined : deferredGlobalRecordSymbol;
|
|
51419
|
+
}
|
|
51414
51420
|
function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) {
|
|
51415
51421
|
return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType;
|
|
51416
51422
|
}
|
|
@@ -53849,6 +53855,24 @@ var ts;
|
|
|
53849
53855
|
return !tp.isThisType && ts.isPartOfTypeNode(node) && maybeTypeParameterReference(node) &&
|
|
53850
53856
|
getTypeFromTypeNodeWorker(node) === tp;
|
|
53851
53857
|
case 183:
|
|
53858
|
+
var entityName = node.exprName;
|
|
53859
|
+
var firstIdentifier = ts.getFirstIdentifier(entityName);
|
|
53860
|
+
var firstIdentifierSymbol = getResolvedSymbol(firstIdentifier);
|
|
53861
|
+
var tpDeclaration = tp.symbol.declarations[0];
|
|
53862
|
+
var tpScope_1;
|
|
53863
|
+
if (tpDeclaration.kind === 165) {
|
|
53864
|
+
tpScope_1 = tpDeclaration.parent;
|
|
53865
|
+
}
|
|
53866
|
+
else if (tp.isThisType) {
|
|
53867
|
+
tpScope_1 = tpDeclaration;
|
|
53868
|
+
}
|
|
53869
|
+
else {
|
|
53870
|
+
return true;
|
|
53871
|
+
}
|
|
53872
|
+
if (firstIdentifierSymbol.declarations) {
|
|
53873
|
+
return ts.some(firstIdentifierSymbol.declarations, function (idDecl) { return ts.isNodeDescendantOf(idDecl, tpScope_1); }) ||
|
|
53874
|
+
ts.some(node.typeArguments, containsReference);
|
|
53875
|
+
}
|
|
53852
53876
|
return true;
|
|
53853
53877
|
case 171:
|
|
53854
53878
|
case 170:
|
|
@@ -60389,18 +60413,22 @@ var ts;
|
|
|
60389
60413
|
}
|
|
60390
60414
|
function isTypePresencePossible(type, propName, assumeTrue) {
|
|
60391
60415
|
var prop = getPropertyOfType(type, propName);
|
|
60392
|
-
|
|
60393
|
-
|
|
60394
|
-
|
|
60395
|
-
|
|
60396
|
-
|
|
60397
|
-
|
|
60398
|
-
|
|
60399
|
-
|
|
60400
|
-
|| ts.isThisTypeParameter(type)
|
|
60401
|
-
|| type.flags & 2097152 && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
60416
|
+
return prop ?
|
|
60417
|
+
!!(prop.flags & 16777216) || assumeTrue :
|
|
60418
|
+
!!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
|
|
60419
|
+
}
|
|
60420
|
+
function narrowByInKeyword(type, nameType, assumeTrue) {
|
|
60421
|
+
var name = getPropertyNameFromType(nameType);
|
|
60422
|
+
var isKnownProperty = someType(type, function (t) { return isTypePresencePossible(t, name, true); });
|
|
60423
|
+
if (isKnownProperty) {
|
|
60402
60424
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
60403
60425
|
}
|
|
60426
|
+
if (assumeTrue) {
|
|
60427
|
+
var recordSymbol = getGlobalRecordSymbol();
|
|
60428
|
+
if (recordSymbol) {
|
|
60429
|
+
return getIntersectionType([type, getTypeAliasInstantiation(recordSymbol, [nameType, unknownType])]);
|
|
60430
|
+
}
|
|
60431
|
+
}
|
|
60404
60432
|
return type;
|
|
60405
60433
|
}
|
|
60406
60434
|
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
|
|
@@ -60459,15 +60487,14 @@ var ts;
|
|
|
60459
60487
|
return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
|
|
60460
60488
|
}
|
|
60461
60489
|
var target = getReferenceCandidate(expr.right);
|
|
60462
|
-
var leftType =
|
|
60463
|
-
if (leftType.flags &
|
|
60464
|
-
var name = ts.escapeLeadingUnderscores(leftType.value);
|
|
60490
|
+
var leftType = getTypeOfExpression(expr.left);
|
|
60491
|
+
if (leftType.flags & 8576) {
|
|
60465
60492
|
if (containsMissingType(type) && ts.isAccessExpression(reference) && isMatchingReference(reference.expression, target) &&
|
|
60466
|
-
getAccessedPropertyName(reference) ===
|
|
60493
|
+
getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
|
|
60467
60494
|
return getTypeWithFacts(type, assumeTrue ? 524288 : 65536);
|
|
60468
60495
|
}
|
|
60469
60496
|
if (isMatchingReference(reference, target)) {
|
|
60470
|
-
return narrowByInKeyword(type,
|
|
60497
|
+
return narrowByInKeyword(type, leftType, assumeTrue);
|
|
60471
60498
|
}
|
|
60472
60499
|
}
|
|
60473
60500
|
break;
|
|
@@ -63983,7 +64010,6 @@ var ts;
|
|
|
63983
64010
|
}
|
|
63984
64011
|
return false;
|
|
63985
64012
|
}
|
|
63986
|
-
;
|
|
63987
64013
|
var suggestedMethod = ts.isAssignmentTarget(expr) ? "set" : "get";
|
|
63988
64014
|
if (!hasProp(suggestedMethod)) {
|
|
63989
64015
|
return undefined;
|
|
@@ -67066,6 +67092,9 @@ var ts;
|
|
|
67066
67092
|
}
|
|
67067
67093
|
return booleanType;
|
|
67068
67094
|
}
|
|
67095
|
+
function hasEmptyObjectIntersection(type) {
|
|
67096
|
+
return someType(type, function (t) { return t === unknownEmptyObjectType || !!(t.flags & 2097152) && ts.some(t.types, isEmptyAnonymousObjectType); });
|
|
67097
|
+
}
|
|
67069
67098
|
function checkInExpression(left, right, leftType, rightType) {
|
|
67070
67099
|
if (leftType === silentNeverType || rightType === silentNeverType) {
|
|
67071
67100
|
return silentNeverType;
|
|
@@ -67080,18 +67109,12 @@ var ts;
|
|
|
67080
67109
|
}
|
|
67081
67110
|
}
|
|
67082
67111
|
else {
|
|
67083
|
-
|
|
67084
|
-
if (!(allTypesAssignableToKind(leftType, 402653316 | 296 | 12288) ||
|
|
67085
|
-
isTypeAssignableToKind(leftType, 4194304 | 134217728 | 268435456 | 262144))) {
|
|
67086
|
-
error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol);
|
|
67087
|
-
}
|
|
67112
|
+
checkTypeAssignableTo(checkNonNullType(leftType, left), stringNumberSymbolType, left);
|
|
67088
67113
|
}
|
|
67089
|
-
|
|
67090
|
-
|
|
67091
|
-
|
|
67092
|
-
|
|
67093
|
-
!maybeTypeOfKind(rightTypeConstraint, 67108864 | 58982400 | 524288))) {
|
|
67094
|
-
error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_not_be_a_primitive);
|
|
67114
|
+
if (checkTypeAssignableTo(checkNonNullType(rightType, right), nonPrimitiveType, right)) {
|
|
67115
|
+
if (hasEmptyObjectIntersection(rightType)) {
|
|
67116
|
+
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));
|
|
67117
|
+
}
|
|
67095
67118
|
}
|
|
67096
67119
|
return booleanType;
|
|
67097
67120
|
}
|
|
@@ -74380,7 +74403,7 @@ var ts;
|
|
|
74380
74403
|
}
|
|
74381
74404
|
var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
|
|
74382
74405
|
if (node) {
|
|
74383
|
-
var symbol =
|
|
74406
|
+
var symbol = getReferencedValueOrAliasSymbol(node);
|
|
74384
74407
|
if (isNonLocalAlias(symbol, 111551) && !getTypeOnlyAliasDeclaration(symbol)) {
|
|
74385
74408
|
return getDeclarationOfAliasSymbol(symbol);
|
|
74386
74409
|
}
|
|
@@ -74701,6 +74724,13 @@ var ts;
|
|
|
74701
74724
|
}
|
|
74702
74725
|
return resolveName(location, reference.escapedText, 111551 | 1048576 | 2097152, undefined, undefined, true);
|
|
74703
74726
|
}
|
|
74727
|
+
function getReferencedValueOrAliasSymbol(reference) {
|
|
74728
|
+
var resolvedSymbol = getNodeLinks(reference).resolvedSymbol;
|
|
74729
|
+
if (resolvedSymbol && resolvedSymbol !== unknownSymbol) {
|
|
74730
|
+
return resolvedSymbol;
|
|
74731
|
+
}
|
|
74732
|
+
return resolveName(reference, reference.escapedText, 111551 | 1048576 | 2097152, undefined, undefined, true, undefined, undefined);
|
|
74733
|
+
}
|
|
74704
74734
|
function getReferencedValueDeclaration(referenceIn) {
|
|
74705
74735
|
if (!ts.isGeneratedIdentifier(referenceIn)) {
|
|
74706
74736
|
var reference = ts.getParseTreeNode(referenceIn, ts.isIdentifier);
|
|
@@ -79999,9 +80029,10 @@ var ts;
|
|
|
79999
80029
|
return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined;
|
|
80000
80030
|
}
|
|
80001
80031
|
function shouldEmitAliasDeclaration(node) {
|
|
80002
|
-
return
|
|
80003
|
-
|
|
80004
|
-
|
|
80032
|
+
return ts.isInJSFile(node) ||
|
|
80033
|
+
(compilerOptions.preserveValueImports
|
|
80034
|
+
? resolver.isValueAliasDeclaration(node)
|
|
80035
|
+
: resolver.isReferencedAliasDeclaration(node));
|
|
80005
80036
|
}
|
|
80006
80037
|
}
|
|
80007
80038
|
ts.transformTypeScript = transformTypeScript;
|
|
@@ -90787,7 +90818,7 @@ var ts;
|
|
|
90787
90818
|
var _a;
|
|
90788
90819
|
var primaryDeclaration = (_a = parentSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return ts.getSourceFileOfNode(d) === containingFile; });
|
|
90789
90820
|
var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; });
|
|
90790
|
-
if (augmentingDeclarations) {
|
|
90821
|
+
if (primaryDeclaration && augmentingDeclarations) {
|
|
90791
90822
|
for (var _i = 0, augmentingDeclarations_1 = augmentingDeclarations; _i < augmentingDeclarations_1.length; _i++) {
|
|
90792
90823
|
var augmentations = augmentingDeclarations_1[_i];
|
|
90793
90824
|
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)));
|
|
@@ -98067,7 +98098,6 @@ var ts;
|
|
|
98067
98098
|
return resolutions;
|
|
98068
98099
|
}
|
|
98069
98100
|
ts.loadWithTypeDirectiveCache = loadWithTypeDirectiveCache;
|
|
98070
|
-
;
|
|
98071
98101
|
function getModeForFileReference(ref, containingFileMode) {
|
|
98072
98102
|
return (ts.isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
98073
98103
|
}
|
|
@@ -107282,7 +107312,6 @@ var ts;
|
|
|
107282
107312
|
var colors = createColors(sys);
|
|
107283
107313
|
var header = [];
|
|
107284
107314
|
var terminalWidth = (_b = (_a = sys.getWidthOfTerminal) === null || _a === void 0 ? void 0 : _a.call(sys)) !== null && _b !== void 0 ? _b : 0;
|
|
107285
|
-
;
|
|
107286
107315
|
var tsIconLength = 5;
|
|
107287
107316
|
var tsIconFirstLine = colors.blueBackground(ts.padLeft("", tsIconLength));
|
|
107288
107317
|
var tsIconSecondLine = colors.blueBackground(colors.brightWhite(ts.padLeft("TS ", tsIconLength)));
|