@typescript-deploys/pr-build 4.9.0-pr-50759-10 → 4.9.0-pr-50856-4
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 +89 -61
- package/lib/tsserver.js +124 -95
- package/lib/tsserverlibrary.js +124 -95
- package/lib/typescript.js +123 -93
- package/lib/typescriptServices.js +123 -93
- package/lib/typingsInstaller.js +117 -80
- 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-insiders.
|
|
72
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.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) {
|
|
@@ -8857,12 +8855,31 @@ var ts;
|
|
|
8857
8855
|
pos++;
|
|
8858
8856
|
return token = 0;
|
|
8859
8857
|
}
|
|
8860
|
-
|
|
8858
|
+
var charAfterHash = codePointAt(text, pos + 1);
|
|
8859
|
+
if (charAfterHash === 92) {
|
|
8860
|
+
pos++;
|
|
8861
|
+
var extendedCookedChar_1 = peekExtendedUnicodeEscape();
|
|
8862
|
+
if (extendedCookedChar_1 >= 0 && isIdentifierStart(extendedCookedChar_1, languageVersion)) {
|
|
8863
|
+
pos += 3;
|
|
8864
|
+
tokenFlags |= 8;
|
|
8865
|
+
tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
|
|
8866
|
+
return token = 80;
|
|
8867
|
+
}
|
|
8868
|
+
var cookedChar_1 = peekUnicodeEscape();
|
|
8869
|
+
if (cookedChar_1 >= 0 && isIdentifierStart(cookedChar_1, languageVersion)) {
|
|
8870
|
+
pos += 6;
|
|
8871
|
+
tokenFlags |= 1024;
|
|
8872
|
+
tokenValue = "#" + String.fromCharCode(cookedChar_1) + scanIdentifierParts();
|
|
8873
|
+
return token = 80;
|
|
8874
|
+
}
|
|
8875
|
+
pos--;
|
|
8876
|
+
}
|
|
8877
|
+
if (isIdentifierStart(charAfterHash, languageVersion)) {
|
|
8861
8878
|
pos++;
|
|
8862
|
-
scanIdentifier(
|
|
8879
|
+
scanIdentifier(charAfterHash, languageVersion);
|
|
8863
8880
|
}
|
|
8864
8881
|
else {
|
|
8865
|
-
tokenValue =
|
|
8882
|
+
tokenValue = "#";
|
|
8866
8883
|
error(ts.Diagnostics.Invalid_character, pos++, charSize(ch));
|
|
8867
8884
|
}
|
|
8868
8885
|
return token = 80;
|
|
@@ -10131,7 +10148,7 @@ var ts;
|
|
|
10131
10148
|
}
|
|
10132
10149
|
ts.isToken = isToken;
|
|
10133
10150
|
function isNodeArray(array) {
|
|
10134
|
-
return
|
|
10151
|
+
return ts.hasProperty(array, "pos") && ts.hasProperty(array, "end");
|
|
10135
10152
|
}
|
|
10136
10153
|
ts.isNodeArray = isNodeArray;
|
|
10137
10154
|
function isLiteralKind(kind) {
|
|
@@ -11415,7 +11432,6 @@ var ts;
|
|
|
11415
11432
|
return emitNode && emitNode.flags || 0;
|
|
11416
11433
|
}
|
|
11417
11434
|
ts.getEmitFlags = getEmitFlags;
|
|
11418
|
-
;
|
|
11419
11435
|
function getScriptTargetFeatures() {
|
|
11420
11436
|
return {
|
|
11421
11437
|
es2015: {
|
|
@@ -15506,7 +15522,7 @@ var ts;
|
|
|
15506
15522
|
return node.initializer !== undefined;
|
|
15507
15523
|
}
|
|
15508
15524
|
function isWatchSet(options) {
|
|
15509
|
-
return options.watch &&
|
|
15525
|
+
return options.watch && ts.hasProperty(options, "watch");
|
|
15510
15526
|
}
|
|
15511
15527
|
ts.isWatchSet = isWatchSet;
|
|
15512
15528
|
function closeFileWatcher(watcher) {
|
|
@@ -21716,7 +21732,7 @@ var ts;
|
|
|
21716
21732
|
clone.transformFlags = node.transformFlags;
|
|
21717
21733
|
setOriginalNode(clone, node);
|
|
21718
21734
|
for (var key in node) {
|
|
21719
|
-
if (
|
|
21735
|
+
if (ts.hasProperty(clone, key) || !ts.hasProperty(node, key)) {
|
|
21720
21736
|
continue;
|
|
21721
21737
|
}
|
|
21722
21738
|
clone[key] = node[key];
|
|
@@ -25760,7 +25776,6 @@ var ts;
|
|
|
25760
25776
|
visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
25761
25777
|
visitNode(cbNode, node.type);
|
|
25762
25778
|
}
|
|
25763
|
-
;
|
|
25764
25779
|
function forEachChildInUnionOrIntersectionType(node, cbNode, cbNodes) {
|
|
25765
25780
|
return visitNodes(cbNode, cbNodes, node.types);
|
|
25766
25781
|
}
|
|
@@ -26803,7 +26818,7 @@ var ts;
|
|
|
26803
26818
|
}
|
|
26804
26819
|
function parsePrivateIdentifier() {
|
|
26805
26820
|
var pos = getNodePos();
|
|
26806
|
-
var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.
|
|
26821
|
+
var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenValue()));
|
|
26807
26822
|
nextToken();
|
|
26808
26823
|
return finishNode(node, pos);
|
|
26809
26824
|
}
|
|
@@ -35256,7 +35271,7 @@ var ts;
|
|
|
35256
35271
|
function convertCompilerOptionsForTelemetry(opts) {
|
|
35257
35272
|
var out = {};
|
|
35258
35273
|
for (var key in opts) {
|
|
35259
|
-
if (
|
|
35274
|
+
if (ts.hasProperty(opts, key)) {
|
|
35260
35275
|
var type = getOptionFromName(key);
|
|
35261
35276
|
if (type !== undefined) {
|
|
35262
35277
|
out[key] = getOptionValueWithEmptyStrings(opts[key], type);
|
|
@@ -40758,7 +40773,8 @@ var ts;
|
|
|
40758
40773
|
var emptyTypeLiteralSymbol = createSymbol(2048, "__type");
|
|
40759
40774
|
emptyTypeLiteralSymbol.members = ts.createSymbolTable();
|
|
40760
40775
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
40761
|
-
var
|
|
40776
|
+
var unknownEmptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
40777
|
+
var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType;
|
|
40762
40778
|
var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
40763
40779
|
emptyGenericType.instantiations = new ts.Map();
|
|
40764
40780
|
var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
@@ -40861,6 +40877,7 @@ var ts;
|
|
|
40861
40877
|
var deferredGlobalOmitSymbol;
|
|
40862
40878
|
var deferredGlobalAwaitedSymbol;
|
|
40863
40879
|
var deferredGlobalBigIntType;
|
|
40880
|
+
var deferredGlobalRecordSymbol;
|
|
40864
40881
|
var allPotentiallyUnusedIdentifiers = new ts.Map();
|
|
40865
40882
|
var flowLoopStart = 0;
|
|
40866
40883
|
var flowLoopCount = 0;
|
|
@@ -41569,10 +41586,10 @@ var ts;
|
|
|
41569
41586
|
return (ts.isAssertionExpression(location) && ts.isConstTypeReference(location.type))
|
|
41570
41587
|
|| (ts.isJSDocTypeTag(location) && ts.isConstTypeReference(location.typeExpression));
|
|
41571
41588
|
}
|
|
41572
|
-
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals,
|
|
41589
|
+
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions) {
|
|
41573
41590
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
41574
|
-
if (
|
|
41575
|
-
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals,
|
|
41591
|
+
if (getSpellingSuggestions === void 0) { getSpellingSuggestions = true; }
|
|
41592
|
+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, getSymbol);
|
|
41576
41593
|
}
|
|
41577
41594
|
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) {
|
|
41578
41595
|
var _a, _b, _c;
|
|
@@ -41683,7 +41700,9 @@ var ts;
|
|
|
41683
41700
|
break;
|
|
41684
41701
|
}
|
|
41685
41702
|
if (lastLocation && ts.isStatic(lastLocation)) {
|
|
41686
|
-
|
|
41703
|
+
if (nameNotFoundMessage) {
|
|
41704
|
+
error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters);
|
|
41705
|
+
}
|
|
41687
41706
|
return undefined;
|
|
41688
41707
|
}
|
|
41689
41708
|
break loop;
|
|
@@ -41711,7 +41730,9 @@ var ts;
|
|
|
41711
41730
|
grandparent = location.parent.parent;
|
|
41712
41731
|
if (ts.isClassLike(grandparent) || grandparent.kind === 261) {
|
|
41713
41732
|
if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968)) {
|
|
41714
|
-
|
|
41733
|
+
if (nameNotFoundMessage) {
|
|
41734
|
+
error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
|
|
41735
|
+
}
|
|
41715
41736
|
return undefined;
|
|
41716
41737
|
}
|
|
41717
41738
|
}
|
|
@@ -41871,7 +41892,7 @@ var ts;
|
|
|
41871
41892
|
}
|
|
41872
41893
|
return undefined;
|
|
41873
41894
|
}
|
|
41874
|
-
else if (checkAndReportErrorForInvalidInitializer()) {
|
|
41895
|
+
else if (nameNotFoundMessage && checkAndReportErrorForInvalidInitializer()) {
|
|
41875
41896
|
return undefined;
|
|
41876
41897
|
}
|
|
41877
41898
|
if (nameNotFoundMessage) {
|
|
@@ -47241,7 +47262,6 @@ var ts;
|
|
|
47241
47262
|
return container;
|
|
47242
47263
|
}
|
|
47243
47264
|
}
|
|
47244
|
-
;
|
|
47245
47265
|
}
|
|
47246
47266
|
function getFlowTypeFromCommonJSExport(symbol) {
|
|
47247
47267
|
var file = ts.getSourceFileOfNode(symbol.declarations[0]);
|
|
@@ -51412,6 +51432,10 @@ var ts;
|
|
|
51412
51432
|
function getGlobalBigIntType() {
|
|
51413
51433
|
return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", 0, false))) || emptyObjectType;
|
|
51414
51434
|
}
|
|
51435
|
+
function getGlobalRecordSymbol() {
|
|
51436
|
+
deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol("Record", 2, true) || unknownSymbol);
|
|
51437
|
+
return deferredGlobalRecordSymbol === unknownSymbol ? undefined : deferredGlobalRecordSymbol;
|
|
51438
|
+
}
|
|
51415
51439
|
function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) {
|
|
51416
51440
|
return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType;
|
|
51417
51441
|
}
|
|
@@ -60408,18 +60432,22 @@ var ts;
|
|
|
60408
60432
|
}
|
|
60409
60433
|
function isTypePresencePossible(type, propName, assumeTrue) {
|
|
60410
60434
|
var prop = getPropertyOfType(type, propName);
|
|
60411
|
-
|
|
60412
|
-
|
|
60413
|
-
|
|
60414
|
-
|
|
60415
|
-
|
|
60416
|
-
|
|
60417
|
-
|
|
60418
|
-
|
|
60419
|
-
|| ts.isThisTypeParameter(type)
|
|
60420
|
-
|| type.flags & 2097152 && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
60435
|
+
return prop ?
|
|
60436
|
+
!!(prop.flags & 16777216) || assumeTrue :
|
|
60437
|
+
!!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
|
|
60438
|
+
}
|
|
60439
|
+
function narrowByInKeyword(type, nameType, assumeTrue) {
|
|
60440
|
+
var name = getPropertyNameFromType(nameType);
|
|
60441
|
+
var isKnownProperty = someType(type, function (t) { return isTypePresencePossible(t, name, true); });
|
|
60442
|
+
if (isKnownProperty) {
|
|
60421
60443
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
60422
60444
|
}
|
|
60445
|
+
if (assumeTrue) {
|
|
60446
|
+
var recordSymbol = getGlobalRecordSymbol();
|
|
60447
|
+
if (recordSymbol) {
|
|
60448
|
+
return getIntersectionType([type, getTypeAliasInstantiation(recordSymbol, [nameType, unknownType])]);
|
|
60449
|
+
}
|
|
60450
|
+
}
|
|
60423
60451
|
return type;
|
|
60424
60452
|
}
|
|
60425
60453
|
function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
|
|
@@ -60478,15 +60506,14 @@ var ts;
|
|
|
60478
60506
|
return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
|
|
60479
60507
|
}
|
|
60480
60508
|
var target = getReferenceCandidate(expr.right);
|
|
60481
|
-
var leftType =
|
|
60482
|
-
if (leftType.flags &
|
|
60483
|
-
var name = ts.escapeLeadingUnderscores(leftType.value);
|
|
60509
|
+
var leftType = getTypeOfExpression(expr.left);
|
|
60510
|
+
if (leftType.flags & 8576) {
|
|
60484
60511
|
if (containsMissingType(type) && ts.isAccessExpression(reference) && isMatchingReference(reference.expression, target) &&
|
|
60485
|
-
getAccessedPropertyName(reference) ===
|
|
60512
|
+
getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
|
|
60486
60513
|
return getTypeWithFacts(type, assumeTrue ? 524288 : 65536);
|
|
60487
60514
|
}
|
|
60488
60515
|
if (isMatchingReference(reference, target)) {
|
|
60489
|
-
return narrowByInKeyword(type,
|
|
60516
|
+
return narrowByInKeyword(type, leftType, assumeTrue);
|
|
60490
60517
|
}
|
|
60491
60518
|
}
|
|
60492
60519
|
break;
|
|
@@ -64002,7 +64029,6 @@ var ts;
|
|
|
64002
64029
|
}
|
|
64003
64030
|
return false;
|
|
64004
64031
|
}
|
|
64005
|
-
;
|
|
64006
64032
|
var suggestedMethod = ts.isAssignmentTarget(expr) ? "set" : "get";
|
|
64007
64033
|
if (!hasProp(suggestedMethod)) {
|
|
64008
64034
|
return undefined;
|
|
@@ -67085,6 +67111,9 @@ var ts;
|
|
|
67085
67111
|
}
|
|
67086
67112
|
return booleanType;
|
|
67087
67113
|
}
|
|
67114
|
+
function hasEmptyObjectIntersection(type) {
|
|
67115
|
+
return someType(type, function (t) { return t === unknownEmptyObjectType || !!(t.flags & 2097152) && ts.some(t.types, isEmptyAnonymousObjectType); });
|
|
67116
|
+
}
|
|
67088
67117
|
function checkInExpression(left, right, leftType, rightType) {
|
|
67089
67118
|
if (leftType === silentNeverType || rightType === silentNeverType) {
|
|
67090
67119
|
return silentNeverType;
|
|
@@ -67099,18 +67128,12 @@ var ts;
|
|
|
67099
67128
|
}
|
|
67100
67129
|
}
|
|
67101
67130
|
else {
|
|
67102
|
-
|
|
67103
|
-
if (!(allTypesAssignableToKind(leftType, 402653316 | 296 | 12288) ||
|
|
67104
|
-
isTypeAssignableToKind(leftType, 4194304 | 134217728 | 268435456 | 262144))) {
|
|
67105
|
-
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);
|
|
67106
|
-
}
|
|
67131
|
+
checkTypeAssignableTo(checkNonNullType(leftType, left), stringNumberSymbolType, left);
|
|
67107
67132
|
}
|
|
67108
|
-
|
|
67109
|
-
|
|
67110
|
-
|
|
67111
|
-
|
|
67112
|
-
!maybeTypeOfKind(rightTypeConstraint, 67108864 | 58982400 | 524288))) {
|
|
67113
|
-
error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_not_be_a_primitive);
|
|
67133
|
+
if (checkTypeAssignableTo(checkNonNullType(rightType, right), nonPrimitiveType, right)) {
|
|
67134
|
+
if (hasEmptyObjectIntersection(rightType)) {
|
|
67135
|
+
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));
|
|
67136
|
+
}
|
|
67114
67137
|
}
|
|
67115
67138
|
return booleanType;
|
|
67116
67139
|
}
|
|
@@ -67889,8 +67912,7 @@ var ts;
|
|
|
67889
67912
|
if (inferenceContext && inferenceContext.intraExpressionInferenceSites) {
|
|
67890
67913
|
inferenceContext.intraExpressionInferenceSites = undefined;
|
|
67891
67914
|
}
|
|
67892
|
-
var result = maybeTypeOfKind(type, 2944) &&
|
|
67893
|
-
isLiteralOfContextualType(type, contextualType)) ?
|
|
67915
|
+
var result = maybeTypeOfKind(type, 2944) && isLiteralOfContextualType(type, instantiateContextualType(contextualType, node, undefined)) ?
|
|
67894
67916
|
getRegularTypeOfLiteralType(type) : type;
|
|
67895
67917
|
return result;
|
|
67896
67918
|
}
|
|
@@ -74400,7 +74422,7 @@ var ts;
|
|
|
74400
74422
|
}
|
|
74401
74423
|
var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
|
|
74402
74424
|
if (node) {
|
|
74403
|
-
var symbol =
|
|
74425
|
+
var symbol = getReferencedValueOrAliasSymbol(node);
|
|
74404
74426
|
if (isNonLocalAlias(symbol, 111551) && !getTypeOnlyAliasDeclaration(symbol)) {
|
|
74405
74427
|
return getDeclarationOfAliasSymbol(symbol);
|
|
74406
74428
|
}
|
|
@@ -74721,6 +74743,13 @@ var ts;
|
|
|
74721
74743
|
}
|
|
74722
74744
|
return resolveName(location, reference.escapedText, 111551 | 1048576 | 2097152, undefined, undefined, true);
|
|
74723
74745
|
}
|
|
74746
|
+
function getReferencedValueOrAliasSymbol(reference) {
|
|
74747
|
+
var resolvedSymbol = getNodeLinks(reference).resolvedSymbol;
|
|
74748
|
+
if (resolvedSymbol && resolvedSymbol !== unknownSymbol) {
|
|
74749
|
+
return resolvedSymbol;
|
|
74750
|
+
}
|
|
74751
|
+
return resolveName(reference, reference.escapedText, 111551 | 1048576 | 2097152, undefined, undefined, true, undefined, undefined);
|
|
74752
|
+
}
|
|
74724
74753
|
function getReferencedValueDeclaration(referenceIn) {
|
|
74725
74754
|
if (!ts.isGeneratedIdentifier(referenceIn)) {
|
|
74726
74755
|
var reference = ts.getParseTreeNode(referenceIn, ts.isIdentifier);
|
|
@@ -80019,9 +80048,10 @@ var ts;
|
|
|
80019
80048
|
return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined;
|
|
80020
80049
|
}
|
|
80021
80050
|
function shouldEmitAliasDeclaration(node) {
|
|
80022
|
-
return
|
|
80023
|
-
|
|
80024
|
-
|
|
80051
|
+
return ts.isInJSFile(node) ||
|
|
80052
|
+
(compilerOptions.preserveValueImports
|
|
80053
|
+
? resolver.isValueAliasDeclaration(node)
|
|
80054
|
+
: resolver.isReferencedAliasDeclaration(node));
|
|
80025
80055
|
}
|
|
80026
80056
|
}
|
|
80027
80057
|
ts.transformTypeScript = transformTypeScript;
|
|
@@ -90807,7 +90837,7 @@ var ts;
|
|
|
90807
90837
|
var _a;
|
|
90808
90838
|
var primaryDeclaration = (_a = parentSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return ts.getSourceFileOfNode(d) === containingFile; });
|
|
90809
90839
|
var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; });
|
|
90810
|
-
if (augmentingDeclarations) {
|
|
90840
|
+
if (primaryDeclaration && augmentingDeclarations) {
|
|
90811
90841
|
for (var _i = 0, augmentingDeclarations_1 = augmentingDeclarations; _i < augmentingDeclarations_1.length; _i++) {
|
|
90812
90842
|
var augmentations = augmentingDeclarations_1[_i];
|
|
90813
90843
|
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)));
|
|
@@ -98087,7 +98117,6 @@ var ts;
|
|
|
98087
98117
|
return resolutions;
|
|
98088
98118
|
}
|
|
98089
98119
|
ts.loadWithTypeDirectiveCache = loadWithTypeDirectiveCache;
|
|
98090
|
-
;
|
|
98091
98120
|
function getModeForFileReference(ref, containingFileMode) {
|
|
98092
98121
|
return (ts.isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
98093
98122
|
}
|
|
@@ -107302,7 +107331,6 @@ var ts;
|
|
|
107302
107331
|
var colors = createColors(sys);
|
|
107303
107332
|
var header = [];
|
|
107304
107333
|
var terminalWidth = (_b = (_a = sys.getWidthOfTerminal) === null || _a === void 0 ? void 0 : _a.call(sys)) !== null && _b !== void 0 ? _b : 0;
|
|
107305
|
-
;
|
|
107306
107334
|
var tsIconLength = 5;
|
|
107307
107335
|
var tsIconFirstLine = colors.blueBackground(ts.padLeft("", tsIconLength));
|
|
107308
107336
|
var tsIconSecondLine = colors.blueBackground(colors.brightWhite(ts.padLeft("TS ", tsIconLength)));
|