typescript 4.6.0-dev.20211203 → 4.6.0-dev.20211207
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 +59 -41
- package/lib/tsserver.js +110 -53
- package/lib/tsserverlibrary.d.ts +2 -0
- package/lib/tsserverlibrary.js +110 -53
- package/lib/typescript.d.ts +2 -0
- package/lib/typescript.js +108 -51
- package/lib/typescriptServices.d.ts +2 -0
- package/lib/typescriptServices.js +108 -51
- package/lib/typingsInstaller.js +62 -42
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211207";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -832,7 +832,11 @@ var ts;
|
|
|
832
832
|
}
|
|
833
833
|
return deduplicated;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function createSortedArray() {
|
|
836
|
+
return []; // TODO: GH#19873
|
|
837
|
+
}
|
|
838
|
+
ts.createSortedArray = createSortedArray;
|
|
839
|
+
function insertSorted(array, insert, compare, allowDuplicates) {
|
|
836
840
|
if (array.length === 0) {
|
|
837
841
|
array.push(insert);
|
|
838
842
|
return;
|
|
@@ -841,6 +845,9 @@ var ts;
|
|
|
841
845
|
if (insertIndex < 0) {
|
|
842
846
|
array.splice(~insertIndex, 0, insert);
|
|
843
847
|
}
|
|
848
|
+
else if (allowDuplicates) {
|
|
849
|
+
array.splice(insertIndex, 0, insert);
|
|
850
|
+
}
|
|
844
851
|
}
|
|
845
852
|
ts.insertSorted = insertSorted;
|
|
846
853
|
function sortAndDeduplicate(array, comparer, equalityComparer) {
|
|
@@ -7919,7 +7926,7 @@ var ts;
|
|
|
7919
7926
|
Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
|
|
7920
7927
|
A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
|
|
7921
7928
|
A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
|
|
7922
|
-
|
|
7929
|
+
An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
|
|
7923
7930
|
An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
|
|
7924
7931
|
An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
|
|
7925
7932
|
An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
|
|
@@ -8206,6 +8213,7 @@ var ts;
|
|
|
8206
8213
|
Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, ts.DiagnosticCategory.Error, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),
|
|
8207
8214
|
An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."),
|
|
8208
8215
|
Type_0_recursively_references_itself_as_a_base_type: diag(2310, ts.DiagnosticCategory.Error, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."),
|
|
8216
|
+
Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function: diag(2311, ts.DiagnosticCategory.Error, "Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311", "Cannot find name '{0}'. Did you mean to write this in an async function?"),
|
|
8209
8217
|
An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, ts.DiagnosticCategory.Error, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."),
|
|
8210
8218
|
Type_parameter_0_has_a_circular_constraint: diag(2313, ts.DiagnosticCategory.Error, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."),
|
|
8211
8219
|
Generic_type_0_requires_1_type_argument_s: diag(2314, ts.DiagnosticCategory.Error, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."),
|
|
@@ -20747,6 +20755,10 @@ var ts;
|
|
|
20747
20755
|
return text.replace(/\$/gm, "\\$");
|
|
20748
20756
|
}
|
|
20749
20757
|
ts.escapeSnippetText = escapeSnippetText;
|
|
20758
|
+
function isThisTypeParameter(type) {
|
|
20759
|
+
return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType);
|
|
20760
|
+
}
|
|
20761
|
+
ts.isThisTypeParameter = isThisTypeParameter;
|
|
20750
20762
|
})(ts || (ts = {}));
|
|
20751
20763
|
/* @internal */
|
|
20752
20764
|
var ts;
|
|
@@ -33597,10 +33609,14 @@ var ts;
|
|
|
33597
33609
|
// - "(x,y)" is a comma expression parsed as a signature with two parameters.
|
|
33598
33610
|
// - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
|
|
33599
33611
|
// - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
|
|
33600
|
-
// - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
|
|
33612
|
+
// - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
|
|
33601
33613
|
//
|
|
33602
33614
|
// So we need just a bit of lookahead to ensure that it can only be a signature.
|
|
33603
|
-
var
|
|
33615
|
+
var unwrappedType = type;
|
|
33616
|
+
while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
|
|
33617
|
+
unwrappedType = unwrappedType.type; // Skip parens if need be
|
|
33618
|
+
}
|
|
33619
|
+
var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
|
|
33604
33620
|
if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
|
|
33605
33621
|
// Returning undefined here will cause our caller to rewind to where we started from.
|
|
33606
33622
|
return undefined;
|
|
@@ -41442,7 +41458,10 @@ var ts;
|
|
|
41442
41458
|
}
|
|
41443
41459
|
}
|
|
41444
41460
|
var failedLookupLocations = [];
|
|
41445
|
-
var
|
|
41461
|
+
var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
|
|
41462
|
+
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
41463
|
+
NodeResolutionFeatures.None;
|
|
41464
|
+
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
|
|
41446
41465
|
var resolved = primaryLookup();
|
|
41447
41466
|
var primary = true;
|
|
41448
41467
|
if (!resolved) {
|
|
@@ -42117,13 +42136,15 @@ var ts;
|
|
|
42117
42136
|
// not currently backported to node 12 - https://github.com/nodejs/Release/issues/690
|
|
42118
42137
|
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
42119
42138
|
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
42139
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default";
|
|
42140
|
+
NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
|
|
42120
42141
|
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
42121
42142
|
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
42122
42143
|
function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42123
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
42144
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42124
42145
|
}
|
|
42125
42146
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42126
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
42147
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42127
42148
|
}
|
|
42128
42149
|
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42129
42150
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
@@ -44926,10 +44947,6 @@ var ts;
|
|
|
44926
44947
|
seen.set(identifier.escapedText, currentKind);
|
|
44927
44948
|
continue;
|
|
44928
44949
|
}
|
|
44929
|
-
if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
|
|
44930
|
-
var span = ts.getErrorSpanForNode(file, identifier);
|
|
44931
|
-
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
|
|
44932
|
-
}
|
|
44933
44950
|
}
|
|
44934
44951
|
}
|
|
44935
44952
|
return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
|
|
@@ -45163,7 +45180,7 @@ var ts;
|
|
|
45163
45180
|
}
|
|
45164
45181
|
}
|
|
45165
45182
|
function checkStrictModeNumericLiteral(node) {
|
|
45166
|
-
if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
|
|
45183
|
+
if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
|
|
45167
45184
|
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
|
|
45168
45185
|
}
|
|
45169
45186
|
}
|
|
@@ -46829,6 +46846,7 @@ var ts;
|
|
|
46829
46846
|
getIndexInfosOfType: getIndexInfosOfType,
|
|
46830
46847
|
getSignaturesOfType: getSignaturesOfType,
|
|
46831
46848
|
getIndexTypeOfType: function (type, kind) { return getIndexTypeOfType(type, kind === 0 /* String */ ? stringType : numberType); },
|
|
46849
|
+
getIndexType: function (type) { return getIndexType(type); },
|
|
46832
46850
|
getBaseTypes: getBaseTypes,
|
|
46833
46851
|
getBaseTypeOfLiteralType: getBaseTypeOfLiteralType,
|
|
46834
46852
|
getWidenedType: getWidenedType,
|
|
@@ -48086,11 +48104,12 @@ var ts;
|
|
|
48086
48104
|
*
|
|
48087
48105
|
* @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters.
|
|
48088
48106
|
*/
|
|
48089
|
-
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) {
|
|
48107
|
+
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) {
|
|
48090
48108
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
48091
|
-
|
|
48109
|
+
if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; }
|
|
48110
|
+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol);
|
|
48092
48111
|
}
|
|
48093
|
-
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) {
|
|
48112
|
+
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) {
|
|
48094
48113
|
var _a, _b, _c;
|
|
48095
48114
|
var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location
|
|
48096
48115
|
var result;
|
|
@@ -48407,7 +48426,7 @@ var ts;
|
|
|
48407
48426
|
}
|
|
48408
48427
|
}
|
|
48409
48428
|
if (!result) {
|
|
48410
|
-
if (nameNotFoundMessage) {
|
|
48429
|
+
if (nameNotFoundMessage && produceDiagnostics) {
|
|
48411
48430
|
if (!errorLocation ||
|
|
48412
48431
|
!checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217
|
|
48413
48432
|
!checkAndReportErrorForExtendingInterface(errorLocation) &&
|
|
@@ -48417,7 +48436,7 @@ var ts;
|
|
|
48417
48436
|
!checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
|
|
48418
48437
|
!checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
|
|
48419
48438
|
var suggestion = void 0;
|
|
48420
|
-
if (suggestionCount < maximumSuggestionCount) {
|
|
48439
|
+
if (getSpellingSuggestions && suggestionCount < maximumSuggestionCount) {
|
|
48421
48440
|
suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
|
|
48422
48441
|
var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
|
|
48423
48442
|
if (isGlobalScopeAugmentationDeclaration) {
|
|
@@ -48453,7 +48472,7 @@ var ts;
|
|
|
48453
48472
|
return undefined;
|
|
48454
48473
|
}
|
|
48455
48474
|
// Perform extra checks only if error reporting was requested
|
|
48456
|
-
if (nameNotFoundMessage) {
|
|
48475
|
+
if (nameNotFoundMessage && produceDiagnostics) {
|
|
48457
48476
|
if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields)) {
|
|
48458
48477
|
// We have a match, but the reference occurred within a property initializer and the identifier also binds
|
|
48459
48478
|
// to a local variable in the constructor where the code will be emitted. Note that this is actually allowed
|
|
@@ -48766,10 +48785,12 @@ var ts;
|
|
|
48766
48785
|
}
|
|
48767
48786
|
/* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
|
|
48768
48787
|
* If at any point current node is equal to 'parent' node - return true.
|
|
48788
|
+
* If current node is an IIFE, continue walking up.
|
|
48769
48789
|
* Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
|
|
48770
48790
|
*/
|
|
48771
48791
|
function isSameScopeDescendentOf(initial, parent, stopAt) {
|
|
48772
|
-
return !!parent && !!ts.findAncestor(initial, function (n) { return n ===
|
|
48792
|
+
return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
|
|
48793
|
+
|| (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
|
|
48773
48794
|
}
|
|
48774
48795
|
function getAnyImportSyntax(node) {
|
|
48775
48796
|
switch (node.kind) {
|
|
@@ -50929,7 +50950,7 @@ var ts;
|
|
|
50929
50950
|
context.approximateLength += 6;
|
|
50930
50951
|
return ts.factory.createKeywordTypeNode(147 /* ObjectKeyword */);
|
|
50931
50952
|
}
|
|
50932
|
-
if (isThisTypeParameter(type)) {
|
|
50953
|
+
if (ts.isThisTypeParameter(type)) {
|
|
50933
50954
|
if (context.flags & 4194304 /* InObjectTypeLiteral */) {
|
|
50934
50955
|
if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) {
|
|
50935
50956
|
context.encounteredError = true;
|
|
@@ -58874,7 +58895,7 @@ var ts;
|
|
|
58874
58895
|
}
|
|
58875
58896
|
function getGlobalSymbol(name, meaning, diagnostic) {
|
|
58876
58897
|
// Don't track references for global symbols anyway, so value if `isReference` is arbitrary
|
|
58877
|
-
return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false);
|
|
58898
|
+
return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ false);
|
|
58878
58899
|
}
|
|
58879
58900
|
function getGlobalType(name, arity, reportErrors) {
|
|
58880
58901
|
var symbol = getGlobalTypeSymbol(name, reportErrors);
|
|
@@ -60453,9 +60474,6 @@ var ts;
|
|
|
60453
60474
|
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 8388608 /* IsGenericObjectType */ : 0) |
|
|
60454
60475
|
(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 16777216 /* IsGenericIndexType */ : 0);
|
|
60455
60476
|
}
|
|
60456
|
-
function isThisTypeParameter(type) {
|
|
60457
|
-
return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType);
|
|
60458
|
-
}
|
|
60459
60477
|
function getSimplifiedType(type, writing) {
|
|
60460
60478
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) :
|
|
60461
60479
|
type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) :
|
|
@@ -65554,7 +65572,7 @@ var ts;
|
|
|
65554
65572
|
}
|
|
65555
65573
|
function getBaseTypeOfLiteralType(type) {
|
|
65556
65574
|
return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
|
|
65557
|
-
type.flags & 128 /* StringLiteral */ ? stringType :
|
|
65575
|
+
type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
|
|
65558
65576
|
type.flags & 256 /* NumberLiteral */ ? numberType :
|
|
65559
65577
|
type.flags & 2048 /* BigIntLiteral */ ? bigintType :
|
|
65560
65578
|
type.flags & 512 /* BooleanLiteral */ ? booleanType :
|
|
@@ -65653,7 +65671,7 @@ var ts;
|
|
|
65653
65671
|
// flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
|
|
65654
65672
|
// no flags for all other types (including non-falsy literal types).
|
|
65655
65673
|
function getFalsyFlags(type) {
|
|
65656
|
-
return type.flags &
|
|
65674
|
+
return type.flags & 3145728 /* UnionOrIntersection */ ? getFalsyFlagsOfTypes(type.types) :
|
|
65657
65675
|
type.flags & 128 /* StringLiteral */ ? type.value === "" ? 128 /* StringLiteral */ : 0 :
|
|
65658
65676
|
type.flags & 256 /* NumberLiteral */ ? type.value === 0 ? 256 /* NumberLiteral */ : 0 :
|
|
65659
65677
|
type.flags & 2048 /* BigIntLiteral */ ? isZeroBigInt(type) ? 2048 /* BigIntLiteral */ : 0 :
|
|
@@ -67269,6 +67287,11 @@ var ts;
|
|
|
67269
67287
|
case "BigInt64Array":
|
|
67270
67288
|
case "BigUint64Array":
|
|
67271
67289
|
return ts.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later;
|
|
67290
|
+
case "await":
|
|
67291
|
+
if (ts.isCallExpression(node.parent)) {
|
|
67292
|
+
return ts.Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;
|
|
67293
|
+
}
|
|
67294
|
+
// falls through
|
|
67272
67295
|
default:
|
|
67273
67296
|
if (node.parent.kind === 295 /* ShorthandPropertyAssignment */) {
|
|
67274
67297
|
return ts.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
|
|
@@ -68826,7 +68849,7 @@ var ts;
|
|
|
68826
68849
|
function narrowByInKeyword(type, name, assumeTrue) {
|
|
68827
68850
|
if (type.flags & 1048576 /* Union */
|
|
68828
68851
|
|| type.flags & 524288 /* Object */ && declaredType !== type
|
|
68829
|
-
|| isThisTypeParameter(type)
|
|
68852
|
+
|| ts.isThisTypeParameter(type)
|
|
68830
68853
|
|| type.flags & 2097152 /* Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
|
|
68831
68854
|
return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
|
|
68832
68855
|
}
|
|
@@ -71646,15 +71669,9 @@ var ts;
|
|
|
71646
71669
|
}
|
|
71647
71670
|
}
|
|
71648
71671
|
function isValidSpreadType(type) {
|
|
71649
|
-
|
|
71650
|
-
|
|
71651
|
-
|
|
71652
|
-
return isValidSpreadType(constraint);
|
|
71653
|
-
}
|
|
71654
|
-
}
|
|
71655
|
-
return !!(type.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) ||
|
|
71656
|
-
getFalsyFlags(type) & 117632 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) ||
|
|
71657
|
-
type.flags & 3145728 /* UnionOrIntersection */ && ts.every(type.types, isValidSpreadType));
|
|
71672
|
+
var t = removeDefinitelyFalsyTypes(mapType(type, getBaseConstraintOrType));
|
|
71673
|
+
return !!(t.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) ||
|
|
71674
|
+
t.flags & 3145728 /* UnionOrIntersection */ && ts.every(t.types, isValidSpreadType));
|
|
71658
71675
|
}
|
|
71659
71676
|
function checkJsxSelfClosingElementDeferred(node) {
|
|
71660
71677
|
checkJsxOpeningLikeElementOrOpeningFragment(node);
|
|
@@ -72605,7 +72622,7 @@ var ts;
|
|
|
72605
72622
|
}
|
|
72606
72623
|
var propType;
|
|
72607
72624
|
if (!prop) {
|
|
72608
|
-
var indexInfo = !ts.isPrivateIdentifier(right) && (assignmentKind === 0 /* None */ || !isGenericObjectType(leftType) || isThisTypeParameter(leftType)) ?
|
|
72625
|
+
var indexInfo = !ts.isPrivateIdentifier(right) && (assignmentKind === 0 /* None */ || !isGenericObjectType(leftType) || ts.isThisTypeParameter(leftType)) ?
|
|
72609
72626
|
getApplicableIndexInfoForName(apparentType, right.escapedText) : undefined;
|
|
72610
72627
|
if (!(indexInfo && indexInfo.type)) {
|
|
72611
72628
|
var isUncheckedJS = isUncheckedJSSuggestion(node, leftType.symbol, /*excludeClasses*/ true);
|
|
@@ -72622,7 +72639,7 @@ var ts;
|
|
|
72622
72639
|
return anyType;
|
|
72623
72640
|
}
|
|
72624
72641
|
if (right.escapedText && !checkAndReportErrorForExtendingInterface(node)) {
|
|
72625
|
-
reportNonexistentProperty(right, isThisTypeParameter(leftType) ? apparentType : leftType, isUncheckedJS);
|
|
72642
|
+
reportNonexistentProperty(right, ts.isThisTypeParameter(leftType) ? apparentType : leftType, isUncheckedJS);
|
|
72626
72643
|
}
|
|
72627
72644
|
return errorType;
|
|
72628
72645
|
}
|
|
@@ -72915,7 +72932,7 @@ var ts;
|
|
|
72915
72932
|
}
|
|
72916
72933
|
function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) {
|
|
72917
72934
|
ts.Debug.assert(outerName !== undefined, "outername should always be defined");
|
|
72918
|
-
var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) {
|
|
72935
|
+
var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ true, function (symbols, name, meaning) {
|
|
72919
72936
|
ts.Debug.assertEqual(outerName, name, "name should equal outerName");
|
|
72920
72937
|
var symbol = getSymbol(symbols, name, meaning);
|
|
72921
72938
|
// Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
|
|
@@ -73161,7 +73178,7 @@ var ts;
|
|
|
73161
73178
|
}
|
|
73162
73179
|
var effectiveIndexType = isForInVariableForNumericPropertyNames(indexExpression) ? numberType : indexType;
|
|
73163
73180
|
var accessFlags = ts.isAssignmentTarget(node) ?
|
|
73164
|
-
4 /* Writing */ | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? 2 /* NoIndexSignatures */ : 0) :
|
|
73181
|
+
4 /* Writing */ | (isGenericObjectType(objectType) && !ts.isThisTypeParameter(objectType) ? 2 /* NoIndexSignatures */ : 0) :
|
|
73165
73182
|
32 /* ExpressionPosition */;
|
|
73166
73183
|
var indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, accessFlags, node) || errorType;
|
|
73167
73184
|
return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, getNodeLinks(node).resolvedSymbol, indexedAccessType, indexExpression, checkMode), node);
|
|
@@ -85923,9 +85940,12 @@ var ts;
|
|
|
85923
85940
|
seen.set(effectiveName, currentKind);
|
|
85924
85941
|
}
|
|
85925
85942
|
else {
|
|
85926
|
-
if ((currentKind &
|
|
85943
|
+
if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
|
|
85927
85944
|
grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
|
|
85928
85945
|
}
|
|
85946
|
+
else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
|
|
85947
|
+
grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
|
|
85948
|
+
}
|
|
85929
85949
|
else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
|
|
85930
85950
|
if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
|
|
85931
85951
|
seen.set(effectiveName, currentKind | existingKind);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.6.0-dev.
|
|
5
|
+
"version": "4.6.0-dev.20211207",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|