@typescript-deploys/pr-build 4.6.0-pr-47078-3 → 4.6.0-pr-47183-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es2020.intl.d.ts +1 -1
- package/lib/tsc.js +47 -35
- package/lib/tsserver.js +57 -47
- package/lib/tsserverlibrary.js +57 -47
- package/lib/typescript.js +57 -47
- package/lib/typescriptServices.js +57 -47
- package/lib/typingsInstaller.js +54 -38
- package/package.json +2 -1
package/lib/lib.es2020.intl.d.ts
CHANGED
|
@@ -319,7 +319,7 @@ declare namespace Intl {
|
|
|
319
319
|
*
|
|
320
320
|
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/of).
|
|
321
321
|
*/
|
|
322
|
-
of(code: string): string;
|
|
322
|
+
of(code: string): string | undefined;
|
|
323
323
|
/**
|
|
324
324
|
* Returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current
|
|
325
325
|
* [`Intl/DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.
|
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.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20211217";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -15608,7 +15608,7 @@ var ts;
|
|
|
15608
15608
|
}
|
|
15609
15609
|
ts.getAllowJSCompilerOption = getAllowJSCompilerOption;
|
|
15610
15610
|
function getUseDefineForClassFields(compilerOptions) {
|
|
15611
|
-
return compilerOptions.useDefineForClassFields === undefined ? getEmitScriptTarget(compilerOptions)
|
|
15611
|
+
return compilerOptions.useDefineForClassFields === undefined ? getEmitScriptTarget(compilerOptions) >= 9 : compilerOptions.useDefineForClassFields;
|
|
15612
15612
|
}
|
|
15613
15613
|
ts.getUseDefineForClassFields = getUseDefineForClassFields;
|
|
15614
15614
|
function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
|
|
@@ -27016,7 +27016,7 @@ var ts;
|
|
|
27016
27016
|
return true;
|
|
27017
27017
|
}
|
|
27018
27018
|
}
|
|
27019
|
-
else if (third === 27) {
|
|
27019
|
+
else if (third === 27 || third === 63) {
|
|
27020
27020
|
return true;
|
|
27021
27021
|
}
|
|
27022
27022
|
return false;
|
|
@@ -45769,7 +45769,8 @@ var ts;
|
|
|
45769
45769
|
return false;
|
|
45770
45770
|
}
|
|
45771
45771
|
function getBaseTypeNodeOfClass(type) {
|
|
45772
|
-
|
|
45772
|
+
var decl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
|
|
45773
|
+
return decl && ts.getEffectiveBaseTypeNode(decl);
|
|
45773
45774
|
}
|
|
45774
45775
|
function getConstructorsForTypeArguments(type, typeArgumentNodes, location) {
|
|
45775
45776
|
var typeArgCount = ts.length(typeArgumentNodes);
|
|
@@ -45783,8 +45784,8 @@ var ts;
|
|
|
45783
45784
|
}
|
|
45784
45785
|
function getBaseConstructorTypeOfClass(type) {
|
|
45785
45786
|
if (!type.resolvedBaseConstructorType) {
|
|
45786
|
-
var decl = type.symbol
|
|
45787
|
-
var extended = ts.getEffectiveBaseTypeNode(decl);
|
|
45787
|
+
var decl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
|
|
45788
|
+
var extended = decl && ts.getEffectiveBaseTypeNode(decl);
|
|
45788
45789
|
var baseTypeNode = getBaseTypeNodeOfClass(type);
|
|
45789
45790
|
if (!baseTypeNode) {
|
|
45790
45791
|
return type.resolvedBaseConstructorType = undefinedType;
|
|
@@ -47518,8 +47519,14 @@ var ts;
|
|
|
47518
47519
|
}
|
|
47519
47520
|
return type;
|
|
47520
47521
|
}
|
|
47522
|
+
function isMappedTypeGenericIndexedAccess(type) {
|
|
47523
|
+
return type.flags & 8388608 && ts.getObjectFlags(type.objectType) & 32 &&
|
|
47524
|
+
!isGenericMappedType(type.objectType) && isGenericIndexType(type.indexType);
|
|
47525
|
+
}
|
|
47521
47526
|
function getApparentType(type) {
|
|
47522
|
-
var t = type.flags & 465829888 ?
|
|
47527
|
+
var t = !(type.flags & 465829888) ? type :
|
|
47528
|
+
isMappedTypeGenericIndexedAccess(type) ? substituteIndexedMappedType(type.objectType, type.indexType) :
|
|
47529
|
+
getBaseConstraintOfType(type) || unknownType;
|
|
47523
47530
|
return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) :
|
|
47524
47531
|
t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) :
|
|
47525
47532
|
t.flags & 402653316 ? globalStringType :
|
|
@@ -47760,7 +47767,7 @@ var ts;
|
|
|
47760
47767
|
return symbol_1;
|
|
47761
47768
|
}
|
|
47762
47769
|
}
|
|
47763
|
-
return getPropertyOfObjectType(globalObjectType, name);
|
|
47770
|
+
return globalObjectType === undefined ? undefined : getPropertyOfObjectType(globalObjectType, name);
|
|
47764
47771
|
}
|
|
47765
47772
|
if (type.flags & 3145728) {
|
|
47766
47773
|
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
@@ -48052,6 +48059,8 @@ var ts;
|
|
|
48052
48059
|
case 205:
|
|
48053
48060
|
case 206:
|
|
48054
48061
|
return traverse(node.expression);
|
|
48062
|
+
case 294:
|
|
48063
|
+
return traverse(node.initializer);
|
|
48055
48064
|
default:
|
|
48056
48065
|
return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);
|
|
48057
48066
|
}
|
|
@@ -54776,7 +54785,7 @@ var ts;
|
|
|
54776
54785
|
return result;
|
|
54777
54786
|
}
|
|
54778
54787
|
function getFalsyFlags(type) {
|
|
54779
|
-
return type.flags &
|
|
54788
|
+
return type.flags & 1048576 ? getFalsyFlagsOfTypes(type.types) :
|
|
54780
54789
|
type.flags & 128 ? type.value === "" ? 128 : 0 :
|
|
54781
54790
|
type.flags & 256 ? type.value === 0 ? 256 : 0 :
|
|
54782
54791
|
type.flags & 2048 ? isZeroBigInt(type) ? 2048 : 0 :
|
|
@@ -55554,12 +55563,14 @@ var ts;
|
|
|
55554
55563
|
target = getActualTypeVariable(target);
|
|
55555
55564
|
}
|
|
55556
55565
|
if (target.flags & 8650752) {
|
|
55557
|
-
if (
|
|
55558
|
-
(priority & 128 && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {
|
|
55566
|
+
if (source === nonInferrableAnyType || source === silentNeverType || (priority & 128 && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {
|
|
55559
55567
|
return;
|
|
55560
55568
|
}
|
|
55561
55569
|
var inference = getInferenceInfoForType(target);
|
|
55562
55570
|
if (inference) {
|
|
55571
|
+
if (ts.getObjectFlags(source) & 524288) {
|
|
55572
|
+
return;
|
|
55573
|
+
}
|
|
55563
55574
|
if (!inference.isFixed) {
|
|
55564
55575
|
if (inference.priority === undefined || priority < inference.priority) {
|
|
55565
55576
|
inference.candidates = undefined;
|
|
@@ -55588,18 +55599,16 @@ var ts;
|
|
|
55588
55599
|
inferencePriority = Math.min(inferencePriority, priority);
|
|
55589
55600
|
return;
|
|
55590
55601
|
}
|
|
55591
|
-
|
|
55592
|
-
|
|
55593
|
-
|
|
55594
|
-
|
|
55595
|
-
|
|
55596
|
-
|
|
55597
|
-
|
|
55598
|
-
|
|
55599
|
-
|
|
55600
|
-
|
|
55601
|
-
invokeOnce(source, simplified_1, inferFromTypes);
|
|
55602
|
-
}
|
|
55602
|
+
var simplified = getSimplifiedType(target, false);
|
|
55603
|
+
if (simplified !== target) {
|
|
55604
|
+
inferFromTypes(source, simplified);
|
|
55605
|
+
}
|
|
55606
|
+
else if (target.flags & 8388608) {
|
|
55607
|
+
var indexType = getSimplifiedType(target.indexType, false);
|
|
55608
|
+
if (indexType.flags & 465829888) {
|
|
55609
|
+
var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, false), indexType, false);
|
|
55610
|
+
if (simplified_1 && simplified_1 !== target) {
|
|
55611
|
+
inferFromTypes(source, simplified_1);
|
|
55603
55612
|
}
|
|
55604
55613
|
}
|
|
55605
55614
|
}
|
|
@@ -58116,7 +58125,7 @@ var ts;
|
|
|
58116
58125
|
var substituteConstraints = !(checkMode && checkMode & 2) &&
|
|
58117
58126
|
someType(type, isGenericTypeWithUnionConstraint) &&
|
|
58118
58127
|
(isConstraintPosition(type, reference) || hasNonBindingPatternContextualTypeWithNoGenericTypes(reference));
|
|
58119
|
-
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 ? getBaseConstraintOrType(t) : t; }) : type;
|
|
58128
|
+
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
|
|
58120
58129
|
}
|
|
58121
58130
|
function isExportOrExportExpression(location) {
|
|
58122
58131
|
return !!ts.findAncestor(location, function (n) {
|
|
@@ -60563,11 +60572,14 @@ var ts;
|
|
|
60563
60572
|
if (!ts.getContainingClass(privId)) {
|
|
60564
60573
|
return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
60565
60574
|
}
|
|
60566
|
-
if (!ts.
|
|
60567
|
-
|
|
60568
|
-
|
|
60569
|
-
|
|
60570
|
-
|
|
60575
|
+
if (!ts.isForInStatement(privId.parent)) {
|
|
60576
|
+
if (!ts.isExpressionNode(privId)) {
|
|
60577
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression);
|
|
60578
|
+
}
|
|
60579
|
+
var isInOperation = ts.isBinaryExpression(privId.parent) && privId.parent.operatorToken.kind === 101;
|
|
60580
|
+
if (!getSymbolForPrivateIdentifierExpression(privId) && !isInOperation) {
|
|
60581
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.Cannot_find_name_0, ts.idText(privId));
|
|
60582
|
+
}
|
|
60571
60583
|
}
|
|
60572
60584
|
return false;
|
|
60573
60585
|
}
|
|
@@ -68839,7 +68851,7 @@ var ts;
|
|
|
68839
68851
|
for (var _a = 0, properties_4 = properties_5; _a < properties_4.length; _a++) {
|
|
68840
68852
|
var prop = properties_4[_a];
|
|
68841
68853
|
var existing = seen.get(prop.escapedName);
|
|
68842
|
-
if (existing &&
|
|
68854
|
+
if (existing && prop.parent === existing.parent) {
|
|
68843
68855
|
seen.delete(prop.escapedName);
|
|
68844
68856
|
}
|
|
68845
68857
|
}
|
|
@@ -69124,7 +69136,7 @@ var ts;
|
|
|
69124
69136
|
if (memberSymbol) {
|
|
69125
69137
|
var declaration = memberSymbol.valueDeclaration;
|
|
69126
69138
|
if (declaration !== member) {
|
|
69127
|
-
if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member)) {
|
|
69139
|
+
if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member) && ts.isEnumDeclaration(declaration.parent)) {
|
|
69128
69140
|
return getEnumMemberValue(declaration);
|
|
69129
69141
|
}
|
|
69130
69142
|
error(expr, ts.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums);
|
|
@@ -72182,7 +72194,7 @@ var ts;
|
|
|
72182
72194
|
checkGrammarComputedPropertyName(name);
|
|
72183
72195
|
}
|
|
72184
72196
|
if (prop.kind === 295 && !inDestructuring && prop.objectAssignmentInitializer) {
|
|
72185
|
-
|
|
72197
|
+
grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);
|
|
72186
72198
|
}
|
|
72187
72199
|
if (name.kind === 80) {
|
|
72188
72200
|
grammarErrorOnNode(name, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -76686,7 +76698,7 @@ var ts;
|
|
|
76686
76698
|
var compilerOptions = context.getCompilerOptions();
|
|
76687
76699
|
var languageVersion = ts.getEmitScriptTarget(compilerOptions);
|
|
76688
76700
|
var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
|
|
76689
|
-
var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion <
|
|
76701
|
+
var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9;
|
|
76690
76702
|
var shouldTransformSuperInStaticInitializers = (languageVersion <= 8 || !useDefineForClassFields) && languageVersion >= 2;
|
|
76691
76703
|
var shouldTransformThisInStaticInitializers = languageVersion <= 8 || !useDefineForClassFields;
|
|
76692
76704
|
var previousOnSubstituteNode = context.onSubstituteNode;
|
|
@@ -76706,7 +76718,7 @@ var ts;
|
|
|
76706
76718
|
function transformSourceFile(node) {
|
|
76707
76719
|
var options = context.getCompilerOptions();
|
|
76708
76720
|
if (node.isDeclarationFile
|
|
76709
|
-
|| useDefineForClassFields && ts.getEmitScriptTarget(options)
|
|
76721
|
+
|| useDefineForClassFields && ts.getEmitScriptTarget(options) >= 9) {
|
|
76710
76722
|
return node;
|
|
76711
76723
|
}
|
|
76712
76724
|
var visited = ts.visitEachChild(node, visitor, context);
|
|
@@ -77376,7 +77388,7 @@ var ts;
|
|
|
77376
77388
|
return false;
|
|
77377
77389
|
}
|
|
77378
77390
|
if (useDefineForClassFields) {
|
|
77379
|
-
return languageVersion <
|
|
77391
|
+
return languageVersion < 9;
|
|
77380
77392
|
}
|
|
77381
77393
|
return ts.isInitializedProperty(member) || shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifierClassElementDeclaration(member);
|
|
77382
77394
|
}
|
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20211217";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -19716,7 +19716,7 @@ var ts;
|
|
|
19716
19716
|
}
|
|
19717
19717
|
ts.getAllowJSCompilerOption = getAllowJSCompilerOption;
|
|
19718
19718
|
function getUseDefineForClassFields(compilerOptions) {
|
|
19719
|
-
return compilerOptions.useDefineForClassFields === undefined ? getEmitScriptTarget(compilerOptions)
|
|
19719
|
+
return compilerOptions.useDefineForClassFields === undefined ? getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
|
|
19720
19720
|
}
|
|
19721
19721
|
ts.getUseDefineForClassFields = getUseDefineForClassFields;
|
|
19722
19722
|
function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
|
|
@@ -33531,7 +33531,7 @@ var ts;
|
|
|
33531
33531
|
return true;
|
|
33532
33532
|
}
|
|
33533
33533
|
}
|
|
33534
|
-
else if (third === 27 /* CommaToken */) {
|
|
33534
|
+
else if (third === 27 /* CommaToken */ || third === 63 /* EqualsToken */) {
|
|
33535
33535
|
return true;
|
|
33536
33536
|
}
|
|
33537
33537
|
return false;
|
|
@@ -55397,7 +55397,8 @@ var ts;
|
|
|
55397
55397
|
return false;
|
|
55398
55398
|
}
|
|
55399
55399
|
function getBaseTypeNodeOfClass(type) {
|
|
55400
|
-
|
|
55400
|
+
var decl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
|
|
55401
|
+
return decl && ts.getEffectiveBaseTypeNode(decl);
|
|
55401
55402
|
}
|
|
55402
55403
|
function getConstructorsForTypeArguments(type, typeArgumentNodes, location) {
|
|
55403
55404
|
var typeArgCount = ts.length(typeArgumentNodes);
|
|
@@ -55419,8 +55420,8 @@ var ts;
|
|
|
55419
55420
|
*/
|
|
55420
55421
|
function getBaseConstructorTypeOfClass(type) {
|
|
55421
55422
|
if (!type.resolvedBaseConstructorType) {
|
|
55422
|
-
var decl = type.symbol
|
|
55423
|
-
var extended = ts.getEffectiveBaseTypeNode(decl);
|
|
55423
|
+
var decl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
|
|
55424
|
+
var extended = decl && ts.getEffectiveBaseTypeNode(decl);
|
|
55424
55425
|
var baseTypeNode = getBaseTypeNodeOfClass(type);
|
|
55425
55426
|
if (!baseTypeNode) {
|
|
55426
55427
|
return type.resolvedBaseConstructorType = undefinedType;
|
|
@@ -57425,13 +57426,23 @@ var ts;
|
|
|
57425
57426
|
}
|
|
57426
57427
|
return type;
|
|
57427
57428
|
}
|
|
57429
|
+
function isMappedTypeGenericIndexedAccess(type) {
|
|
57430
|
+
return type.flags & 8388608 /* IndexedAccess */ && ts.getObjectFlags(type.objectType) & 32 /* Mapped */ &&
|
|
57431
|
+
!isGenericMappedType(type.objectType) && isGenericIndexType(type.indexType);
|
|
57432
|
+
}
|
|
57428
57433
|
/**
|
|
57429
57434
|
* For a type parameter, return the base constraint of the type parameter. For the string, number,
|
|
57430
57435
|
* boolean, and symbol primitive types, return the corresponding object types. Otherwise return the
|
|
57431
57436
|
* type itself.
|
|
57432
57437
|
*/
|
|
57433
57438
|
function getApparentType(type) {
|
|
57434
|
-
|
|
57439
|
+
// We obtain the base constraint for all instantiable types, except indexed access types of the form
|
|
57440
|
+
// { [P in K]: E }[X], where K is non-generic and X is generic. For those types, we instead substitute an
|
|
57441
|
+
// instantiation of E where P is replaced with X. We do this because getBaseConstraintOfType directly
|
|
57442
|
+
// lowers to an instantiation where X's constraint is substituted for X, which isn't always desirable.
|
|
57443
|
+
var t = !(type.flags & 465829888 /* Instantiable */) ? type :
|
|
57444
|
+
isMappedTypeGenericIndexedAccess(type) ? substituteIndexedMappedType(type.objectType, type.indexType) :
|
|
57445
|
+
getBaseConstraintOfType(type) || unknownType;
|
|
57435
57446
|
return ts.getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) :
|
|
57436
57447
|
t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) :
|
|
57437
57448
|
t.flags & 402653316 /* StringLike */ ? globalStringType :
|
|
@@ -57713,7 +57724,7 @@ var ts;
|
|
|
57713
57724
|
return symbol_1;
|
|
57714
57725
|
}
|
|
57715
57726
|
}
|
|
57716
|
-
return getPropertyOfObjectType(globalObjectType, name);
|
|
57727
|
+
return globalObjectType === undefined ? undefined : getPropertyOfObjectType(globalObjectType, name);
|
|
57717
57728
|
}
|
|
57718
57729
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
57719
57730
|
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
@@ -58047,6 +58058,8 @@ var ts;
|
|
|
58047
58058
|
case 205 /* PropertyAccessExpression */:
|
|
58048
58059
|
case 206 /* ElementAccessExpression */:
|
|
58049
58060
|
return traverse(node.expression);
|
|
58061
|
+
case 294 /* PropertyAssignment */:
|
|
58062
|
+
return traverse(node.initializer);
|
|
58050
58063
|
default:
|
|
58051
58064
|
return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);
|
|
58052
58065
|
}
|
|
@@ -65702,7 +65715,7 @@ var ts;
|
|
|
65702
65715
|
// flags for the string, number, boolean, "", 0, false, void, undefined, or null types respectively. Returns
|
|
65703
65716
|
// no flags for all other types (including non-falsy literal types).
|
|
65704
65717
|
function getFalsyFlags(type) {
|
|
65705
|
-
return type.flags &
|
|
65718
|
+
return type.flags & 1048576 /* Union */ ? getFalsyFlagsOfTypes(type.types) :
|
|
65706
65719
|
type.flags & 128 /* StringLiteral */ ? type.value === "" ? 128 /* StringLiteral */ : 0 :
|
|
65707
65720
|
type.flags & 256 /* NumberLiteral */ ? type.value === 0 ? 256 /* NumberLiteral */ : 0 :
|
|
65708
65721
|
type.flags & 2048 /* BigIntLiteral */ ? isZeroBigInt(type) ? 2048 /* BigIntLiteral */ : 0 :
|
|
@@ -66616,12 +66629,14 @@ var ts;
|
|
|
66616
66629
|
// not contain anyFunctionType when we come back to this argument for its second round
|
|
66617
66630
|
// of inference. Also, we exclude inferences for silentNeverType (which is used as a wildcard
|
|
66618
66631
|
// when constructing types from type parameters that had no inference candidates).
|
|
66619
|
-
if (
|
|
66620
|
-
(priority & 128 /* ReturnType */ && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {
|
|
66632
|
+
if (source === nonInferrableAnyType || source === silentNeverType || (priority & 128 /* ReturnType */ && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {
|
|
66621
66633
|
return;
|
|
66622
66634
|
}
|
|
66623
66635
|
var inference = getInferenceInfoForType(target);
|
|
66624
66636
|
if (inference) {
|
|
66637
|
+
if (ts.getObjectFlags(source) & 524288 /* NonInferrableType */) {
|
|
66638
|
+
return;
|
|
66639
|
+
}
|
|
66625
66640
|
if (!inference.isFixed) {
|
|
66626
66641
|
if (inference.priority === undefined || priority < inference.priority) {
|
|
66627
66642
|
inference.candidates = undefined;
|
|
@@ -66652,21 +66667,19 @@ var ts;
|
|
|
66652
66667
|
inferencePriority = Math.min(inferencePriority, priority);
|
|
66653
66668
|
return;
|
|
66654
66669
|
}
|
|
66655
|
-
|
|
66656
|
-
|
|
66657
|
-
|
|
66658
|
-
|
|
66659
|
-
|
|
66660
|
-
|
|
66661
|
-
|
|
66662
|
-
|
|
66663
|
-
|
|
66664
|
-
|
|
66665
|
-
|
|
66666
|
-
|
|
66667
|
-
|
|
66668
|
-
invokeOnce(source, simplified_1, inferFromTypes);
|
|
66669
|
-
}
|
|
66670
|
+
// Infer to the simplified version of an indexed access, if possible, to (hopefully) expose more bare type parameters to the inference engine
|
|
66671
|
+
var simplified = getSimplifiedType(target, /*writing*/ false);
|
|
66672
|
+
if (simplified !== target) {
|
|
66673
|
+
inferFromTypes(source, simplified);
|
|
66674
|
+
}
|
|
66675
|
+
else if (target.flags & 8388608 /* IndexedAccess */) {
|
|
66676
|
+
var indexType = getSimplifiedType(target.indexType, /*writing*/ false);
|
|
66677
|
+
// Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider
|
|
66678
|
+
// that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can.
|
|
66679
|
+
if (indexType.flags & 465829888 /* Instantiable */) {
|
|
66680
|
+
var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, /*writing*/ false), indexType, /*writing*/ false);
|
|
66681
|
+
if (simplified_1 && simplified_1 !== target) {
|
|
66682
|
+
inferFromTypes(source, simplified_1);
|
|
66670
66683
|
}
|
|
66671
66684
|
}
|
|
66672
66685
|
}
|
|
@@ -69536,7 +69549,7 @@ var ts;
|
|
|
69536
69549
|
var substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) &&
|
|
69537
69550
|
someType(type, isGenericTypeWithUnionConstraint) &&
|
|
69538
69551
|
(isConstraintPosition(type, reference) || hasNonBindingPatternContextualTypeWithNoGenericTypes(reference));
|
|
69539
|
-
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
|
|
69552
|
+
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
|
|
69540
69553
|
}
|
|
69541
69554
|
function isExportOrExportExpression(location) {
|
|
69542
69555
|
return !!ts.findAncestor(location, function (n) {
|
|
@@ -72507,11 +72520,14 @@ var ts;
|
|
|
72507
72520
|
if (!ts.getContainingClass(privId)) {
|
|
72508
72521
|
return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
72509
72522
|
}
|
|
72510
|
-
if (!ts.
|
|
72511
|
-
|
|
72512
|
-
|
|
72513
|
-
|
|
72514
|
-
|
|
72523
|
+
if (!ts.isForInStatement(privId.parent)) {
|
|
72524
|
+
if (!ts.isExpressionNode(privId)) {
|
|
72525
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression);
|
|
72526
|
+
}
|
|
72527
|
+
var isInOperation = ts.isBinaryExpression(privId.parent) && privId.parent.operatorToken.kind === 101 /* InKeyword */;
|
|
72528
|
+
if (!getSymbolForPrivateIdentifierExpression(privId) && !isInOperation) {
|
|
72529
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.Cannot_find_name_0, ts.idText(privId));
|
|
72530
|
+
}
|
|
72515
72531
|
}
|
|
72516
72532
|
return false;
|
|
72517
72533
|
}
|
|
@@ -82228,7 +82244,7 @@ var ts;
|
|
|
82228
82244
|
for (var _a = 0, properties_4 = properties_5; _a < properties_4.length; _a++) {
|
|
82229
82245
|
var prop = properties_4[_a];
|
|
82230
82246
|
var existing = seen.get(prop.escapedName);
|
|
82231
|
-
if (existing &&
|
|
82247
|
+
if (existing && prop.parent === existing.parent) {
|
|
82232
82248
|
seen.delete(prop.escapedName);
|
|
82233
82249
|
}
|
|
82234
82250
|
}
|
|
@@ -82525,7 +82541,7 @@ var ts;
|
|
|
82525
82541
|
if (memberSymbol) {
|
|
82526
82542
|
var declaration = memberSymbol.valueDeclaration;
|
|
82527
82543
|
if (declaration !== member) {
|
|
82528
|
-
if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member)) {
|
|
82544
|
+
if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member) && ts.isEnumDeclaration(declaration.parent)) {
|
|
82529
82545
|
return getEnumMemberValue(declaration);
|
|
82530
82546
|
}
|
|
82531
82547
|
error(expr, ts.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums);
|
|
@@ -85898,7 +85914,7 @@ var ts;
|
|
|
85898
85914
|
if (prop.kind === 295 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) {
|
|
85899
85915
|
// having objectAssignmentInitializer is only valid in ObjectAssignmentPattern
|
|
85900
85916
|
// outside of destructuring it is a syntax error
|
|
85901
|
-
|
|
85917
|
+
grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);
|
|
85902
85918
|
}
|
|
85903
85919
|
if (name.kind === 80 /* PrivateIdentifier */) {
|
|
85904
85920
|
grammarErrorOnNode(name, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -91862,7 +91878,7 @@ var ts;
|
|
|
91862
91878
|
var compilerOptions = context.getCompilerOptions();
|
|
91863
91879
|
var languageVersion = ts.getEmitScriptTarget(compilerOptions);
|
|
91864
91880
|
var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
|
|
91865
|
-
var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion <
|
|
91881
|
+
var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9 /* ES2022 */;
|
|
91866
91882
|
// We don't need to transform `super` property access when targeting ES5, ES3 because
|
|
91867
91883
|
// the es2015 transformation handles those.
|
|
91868
91884
|
var shouldTransformSuperInStaticInitializers = (languageVersion <= 8 /* ES2021 */ || !useDefineForClassFields) && languageVersion >= 2 /* ES2015 */;
|
|
@@ -91892,7 +91908,7 @@ var ts;
|
|
|
91892
91908
|
function transformSourceFile(node) {
|
|
91893
91909
|
var options = context.getCompilerOptions();
|
|
91894
91910
|
if (node.isDeclarationFile
|
|
91895
|
-
|| useDefineForClassFields && ts.getEmitScriptTarget(options)
|
|
91911
|
+
|| useDefineForClassFields && ts.getEmitScriptTarget(options) >= 9 /* ES2022 */) {
|
|
91896
91912
|
return node;
|
|
91897
91913
|
}
|
|
91898
91914
|
var visited = ts.visitEachChild(node, visitor, context);
|
|
@@ -92649,7 +92665,7 @@ var ts;
|
|
|
92649
92665
|
if (useDefineForClassFields) {
|
|
92650
92666
|
// If we are using define semantics and targeting ESNext or higher,
|
|
92651
92667
|
// then we don't need to transform any class properties.
|
|
92652
|
-
return languageVersion <
|
|
92668
|
+
return languageVersion < 9 /* ES2022 */;
|
|
92653
92669
|
}
|
|
92654
92670
|
return ts.isInitializedProperty(member) || shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifierClassElementDeclaration(member);
|
|
92655
92671
|
}
|
|
@@ -123110,13 +123126,6 @@ var ts;
|
|
|
123110
123126
|
|| ts.isImportSpecifier(parent)
|
|
123111
123127
|
|| ts.isImportClause(parent)
|
|
123112
123128
|
|| ts.isImportEqualsDeclaration(parent) && node === parent.name) {
|
|
123113
|
-
var decl = parent;
|
|
123114
|
-
while (decl) {
|
|
123115
|
-
if (ts.isImportEqualsDeclaration(decl) || ts.isImportClause(decl) || ts.isExportDeclaration(decl)) {
|
|
123116
|
-
return decl.isTypeOnly ? 2 /* Type */ : 7 /* All */;
|
|
123117
|
-
}
|
|
123118
|
-
decl = decl.parent;
|
|
123119
|
-
}
|
|
123120
123129
|
return 7 /* All */;
|
|
123121
123130
|
}
|
|
123122
123131
|
else if (isInRightSideOfInternalImportEqualsDeclaration(node)) {
|
|
@@ -157101,11 +157110,12 @@ var ts;
|
|
|
157101
157110
|
var result = [];
|
|
157102
157111
|
return visitor(selection) ? undefined : result;
|
|
157103
157112
|
function visitor(node) {
|
|
157113
|
+
var _a;
|
|
157104
157114
|
if (ts.isTypeReferenceNode(node)) {
|
|
157105
157115
|
if (ts.isIdentifier(node.typeName)) {
|
|
157106
157116
|
var symbol = checker.resolveName(node.typeName.text, node.typeName, 262144 /* TypeParameter */, /* excludeGlobals */ true);
|
|
157107
|
-
|
|
157108
|
-
|
|
157117
|
+
var declaration = ts.tryCast((_a = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _a === void 0 ? void 0 : _a[0], ts.isTypeParameterDeclaration);
|
|
157118
|
+
if (declaration) {
|
|
157109
157119
|
if (rangeContainsSkipTrivia(statement, declaration, file) && !rangeContainsSkipTrivia(selection, declaration, file)) {
|
|
157110
157120
|
ts.pushIfUnique(result, declaration);
|
|
157111
157121
|
}
|